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!

alexg

Forum Replies Created

Viewing 15 posts - 481 through 495 (of 2,211 total)
  • Author
    Posts
  • in reply to: Invalid number of decimals in deposits #9065
    alexg
    Keymaster

    Hello,

    The place where you have placed the hook displays all transactions related to your wallet file, not only transactions related to your WordPress installation. After the wallets_transactions action fires, the plugin will determine whether to save the transaction to the DB or not, based on the deposit addresses.

    Please post in new threads for things that are unrelated to the original issue, i.e. the number of decimals.

    I do not communicate over signal or any other messaging app. This helps keep communication clear and also it allows me to work on development. Additionally, I cannot solve your issues remotely.

    To summarize:
    You have already managed once to modify the number of decimals.

    If you start from the unmodified code of version 0.1.2-beta, then fiddle with the number of decimals, you should be able to resolve the original issue. If you have any other questions on how the code works, please open as many new threads as needed.

    with regards

    in reply to: Invalid number of decimals in deposits #9046
    alexg
    Keymaster

    My apologies, my mistake. You should grep for wallets_turtle_coins, not wallets_turtle_coins_filter.

    Also try to remember if you’ve done this.

    in reply to: Invalid Created Times showing up in the transactions #9045
    alexg
    Keymaster

    Thank you for your kind words.

    The reason I insist on not modifying the code is simply so we know what we’re doing. Otherwise I wouldn’t mind.

    I was like you when I finished my uni studies but then I worked at a big software company where I learned some simple engineering principles that they don’t teach you in uni. Such as taking small steps, and knowing exactly what you do on each step, which is the way of professionals.

    The main mistake you’re making is that you are editing more than one thing at a time.
    1. Always work on one issue at a time.
    2. Always have a ticket or other working area where you collect all information about this particular issue.
    3. Always start from clean code, then find the one thing that you need to change to fix a bug.
    4. Always make changes only after understanding what went wrong.
    5. Do not be quick to code. Only code if you really have to.

    If you don’t do this then you’re not a software engineer, you’re just a hacker and you will experience regressions in your defects. i.e. you’ll think that you’ve fixed something and then it will break again. It’s really a shame that they don’t teach you these things in university.

    The code should work as is. The plugin passes the timestamp to MySQL and the DB server knows how to convert it to date.

    So, observe and describe the issue on clean code. Use var_dump if you have to. You can also use error_log( print_r( $array, true ) ); to write the contents of $array to your logs. Once you spot the problem, only then you can know if you have to change the code.

    with regards

    in reply to: Invalid number of decimals in deposits #9039
    alexg
    Keymaster

    If modifying the coins.csv file has no effect, this can only mean that you’ve overridden the data using the filter elsewhere.

    So grep your functions php or any other theme or plugin code to see if you’ve used the wallets_turtle_coins_filter anywhere.

    Could it be that you’ve done this?

    in reply to: Invalid Created Times showing up in the transactions #9036
    alexg
    Keymaster

    Hello,

    Thank you for starting a new thread for this.

    I can see in your var_dump output in the other thread that your incoming deposit has a timestamp of 1596502204 which looks correct.

    Since you’ve already started hacking the code, know that the timestamp is copied over in function create_deposit_rows() as follows:

    private function create_deposit_rows( &$tx ) {

    $txrow->created_time = isset( $tx->timestamp ) && $tx->timestamp ? absint( $tx->timestamp ) : time();

    }

    First ensure that you have exactly the code as released, then check to see what’s going on in that function.

    Just keep in mind that it’s best not to change anything in the code. If you spot a bug let me know and I’ll fix it. So please check the FAQ under “I want to do changes to the plugin’s code.”

    with regards

    in reply to: Invalid number of decimals in deposits #9035
    alexg
    Keymaster

    Hello,

    Unfortunately right now you do not know what was wrong and what you have fixed.

    The hard coded value is actually being overridden. Check the code in wallets_declare_adapters() to see why. The class Dashed_Slug_Wallets_Coin_Adapter_TurtleCoin is abstract. Its concrete implementations are being eval()‘ed. There is a get_decimals() function in file wallets-turtlecoin.php, line number 133.

    To fix the decimals issue, first ensure that you are using the code as released. Starting from that, see what you can do to change the coin data, NOT the code. This is why I suggested that you try editing the file coins.csv and edit the number of decimals. Because th

    If you leave this fix in, then you will again have problems when I release a new version of the adapter.

    So first ensure that you have a clean copy of 0.1.2-beta, then see how you can modify the decimals column in coins.csv to get the correct number.

    with regards

    with regards

    in reply to: Invalid number of decimals in deposits #9025
    alexg
    Keymaster

    Hello,

    It’s very wise to first start off with a new wallet.

    First, some background:

    This issue with decimals occurs because the wallets always report the amounts as integers (so as not to lose precision with float values). Then, the wallet or plugin knows how many decimals to shift decimals by before displaying the amounts.

    The wallets plugin however stores amounts as decimals always, so the numbers need to be converted. This is why when defining the coin, you need to specify how many decimals it has. The adapter extension comes with the following pre-installed coin data:

    symbol,name,wd fee,move fee,qr pattern,amount pattern,explorer tx uri,icon url,decimals
    TRTL,TurtleCoin,100,0.00001,turtle:%s,%01.2f,https://explorer.turtlecoin.lol/transaction.html?hash=%s,,2
    ARMS,2ACoin,100,0.00001,arms:%s,%01.4f,https://explorer.2acoin.org/?hash=%s#blockchain_transaction,,4

    Note that 2Acoin has 4 decimals. This means that the deposited amount of 1 ARMS would be reported as 10000 ARMS by wallet-api. The coin adapter would then divide that number by 10**4, and would then store the result, 1, to the DB. This is how things are supposed to work.

    You can use the wallets_turtle_coins filter to modify this value. Are you using this filter currently anywhere on your site? Normally you should not be using it. The issue is that I do not see how you could be getting the result that you describe, with the unmodified plugin.

    What you can do:

    Try the following as a test, without resyncing anything and without modifying anything else.

    1. Ensure that you are not currently hooking into wallets_turtle_coins filter from any of your own code.
    2. Edit the file wp-content/plugins/wallets-turtlecoin/assets/coins.csv. On the ARMS line, edit the “decimals” value of 4 and change it to 10. This will make the adapter shift amounts by 6 more decimals.
    3. Delete your ARMS deposits from the DB with DELETE FROM wp_wallets_txs WHERE symbol='ARMS';
    4. Delete max-height again as before and let the wallet sync again. (You don’t need to resync the blockchain or wallets-api only the coin adapter.)
    5. Check that your deposit is now shown correctly as 1 ARMS.
    6. If the deposit is shown correctly now, then also check withdrawals just to make sure everything is fine.

    with regards

    P.S. Please open a new thread about the dates to track this issue.

    in reply to: Is WCMP Still supported #9023
    alexg
    Keymaster

    Hello,

    WCMP support is experimental at best but I will keep it for now. I was considering removing it because I don’t have the time to work on it or improve it, but since it does work in some cases, I will leave it there for whoever is using it.

    What’s not working mainly is automatic disbursal of payments. The plugin extension will warn you in the admin screens about this.

    If you manually approve each commission payout then this will work, as long as the designated admin account still holds the funds and has not spent them.

    Your vendors should be unaffected by this, except for the fact that they can’t receive their payouts automatically. Once you approve their payouts manually, they can then proceed to withdraw their cryptocurrency earnings using [wallets_withdraw].

    Hope this helps. Please let me know if you have any other questions.

    with regards

    in reply to: Deposits don’t come thru #9022
    alexg
    Keymaster

    Hello,

    First of all, I’m assuming you are referring to the CoinPayments adapter extension, so I’ve transferred your post to the correct forum. If you have connected to a full node BYT wallet, let me know.

    Secondly, I’m assuming that Bytex is the only coin you tried. If you had successfully performed other deposits with this coin adapter in the past, and now Bytex only is not working, then let me know about this.

    Deposits not coming through is the most typical issue people experience at first, and it’s usually due to the hosting provider’s firewall.

    Please go through this troubleshooting guide carefully. If you can’t find the issue, then for each step of the guide, please describe exactly what you found. I will be able to advise you on what the problem is.

    with regards

    in reply to: Empty value PHP warning #9009
    alexg
    Keymaster

    Hello,

    Thank you very much for spotting this.

    It’s not a critical error, you can ignore it for now. But I will fix it before the next release of wallets tips.

    I have began work on a new version of this extension, and it will be out before the end of summer.

    with regards

    in reply to: Suggestions: Benefits for users with a special Role #9008
    alexg
    Keymaster

    Hello,

    Thank you for the suggestion.

    It might be possible for me to implement such a feature in the future. This is a big change and requires redesign on all the coin adapters, so it’s unlikely that I would be able to implement it any time soon.

    In any case, it is not possible to withdraw for free, because withdrawals cost blockchain (network) fees.

    If I have any news on this, I will let you know here on this thread.

    with regards

    in reply to: How to add multiple Coins #9002
    alexg
    Keymaster

    OK,

    Please answer all of the points below:

    1. You say you see no coins. Where do you see no coins? At the frontend UIs, or at the admin section (Wallets -> Adapters)?

    2. If the coins are listed in the admin section, what is the status of the coins? If there’s any error in the status column, please copy and paste it so I can see.

    3. Is your plugin file activated? See the Plugins screen and check your PHP file.

    4. What is the exact code you entered in the PHP file? If you show me, I can look at your code to see if there’s any errors.

    with regards

    P.S. In general, please try to be more specific so I can help you. (see point 3 here). Thank you.

    in reply to: How to add multiple Coins #8999
    alexg
    Keymaster

    OK.

    Suppose you want to add two coins, with symbols ABC and XYZ.

    This is how you can use the wallets_multiadapter_coins filter to add more than one coin (I have omitted most of the settings for clarity):

    function wallets_multiadapter_coins_filter( $coins ) {
    
    	$coins['ABC'] = array( // replace ABC with the coin's ticker symbol in this line
    
    		// Coin symbol (again)
    		'symbol' => 'ABC',
    
    		// Coin name
    		'name' => 'ABC coin',
    
    		// MORE SETTINGS GO HERE
    
    		// URL to an 64x64 icon for the coin. Or leave empty to pull the icon from 'assets/sprites/SYMBOL.png'.
    		'icon url' => 'http://www.example.com/abc-coin-icon-64x64.png',
    	);
    
    	$coins['XYZ'] = array( // replace XYZ with the coin's ticker symbol in this line
    
    		// Coin symbol (again)
    		'symbol' => 'XYZ',
    
    		// Coin name
    		'name' => 'XYZ coin',
    
    		// MORE SETTINGS GO HERE
    
    		// URL to an 64x64 icon for the coin. Or leave empty to pull the icon from 'assets/sprites/SYMBOL.png'.
    		'icon url' => 'http://www.example.com/xyz-coin-icon-64x64.png',
    	);
    
    	return $coins;
     }
    
    add_filter( 'wallets_multiadapter_coins', 'wallets_multiadapter_coins_filter' );

    If you really wanted to define multiple functions you could, but there’s no need.

    in reply to: How to add multiple Coins #8996
    alexg
    Keymaster

    Hello,

    Please describe what you did exactly, and which coin adapter you are using. Once you do, I will transfer this thread to the correct forum and will provide assistance.

    with regards

    in reply to: Invalid number of decimals in deposits #8991
    alexg
    Keymaster

    OK again, this is an unrelated issue to the decimals issue.

    1. What do you mean by wp-cli not letting you delete the transient? What was the error?

    2. Have you disabled the object cache you were using (memcached)?

    3. If after scanning the transactions, none were imported, could this be because you have deleted the deposit addresses table? The scan will only insert transactions if the deposit addresses are associated with users. The plugin will not simply import any transactions it sees, because it doesn’t know if they belong to a user or not, unless there’s a mapping in the wp_wallets_adds table (i.e. only deposits to user deposit addresses will be found).

    In any case, here’s a summary of what I think:

    You’re trying out too many things at once. It’s impossible to know what’s wrong. Start out with a fresh wp installation, with a standard theme and no other plugins and no object cache, and with a fresh 2acoin/ARMS wallet, and see if that works. I have tested the adapter with TurtleCoin deposits and withdrawals and it works fine, so it should work fine for you too.

    with regards

Viewing 15 posts - 481 through 495 (of 2,211 total)