bsc-php
bsc-php copied to clipboard
Problem transferring usdt bep20
`<?php error_reporting(E_ALL);
require 'Fenguoz-bsc-php/autoload.php';
$api = new \Binance\NodeApi('https://bsc-dataseed1.binance.org/'); $bnb = new \Binance\Bnb($api);
$config = [ 'contract_address' => '0x55d398326f99059ff775485246999027b3197955', // USDT BEP20 'decimals' => 8, ]; $bep20 = new \Binance\BEP20($api, $config);
// Transaction transfer (offline signature) $from = '2d24*****630f'; $to = '0x080702F42aeEfF08396E8d2EFCeab8c09a13cdE6'; $amount = 1; $apii = new \Binance\BscscanApi("ZPJP****1E"); $fee = $apii->gasPrice();
$transaction = $bep20->transfer($from, $to, $amount,$fee); var_dump($transaction); `
This is my code to transfer usdt bep20, but the output is false
output => bool(false)
@mitmelon can you help in this regard? @Fenguoz @mitmelon
`<?php error_reporting(E_ALL);
require 'Fenguoz-bsc-php/autoload.php';
$api = new \Binance\NodeApi('https://bsc-dataseed1.binance.org/'); $bnb = new \Binance\Bnb($api);
$config = [ 'contract_address' => '0x55d398326f99059ff775485246999027b3197955', // USDT BEP20 'decimals' => 8, ]; $bep20 = new \Binance\BEP20($api, $config);
// Transaction transfer (offline signature) $from = '2d24*****630f'; $to = '0x080702F42aeEfF08396E8d2EFCeab8c09a13cdE6'; $amount = 1; $apii = new \Binance\BscscanApi("ZPJP****1E"); $fee = $apii->gasPrice();
$transaction = $bep20->transfer($from, $to, $amount,$fee); var_dump($transaction); `
This is my code to transfer usdt bep20, but the output is false
output => bool(false)
@mitmelon can you help in this regard? @Fenguoz @mitmelon
The gas fee is th issue... I forgot how I solved it then... But will check it tomorrow.
Meanwhile trying printing out the gas fee to check if it prints...
I think I have a fork of this where it's solved... Let me check...
<?php error_reporting(E_ALL); require 'Fenguoz-bsc-php/autoload.php'; $api = new \Binance\NodeApi('https://bsc-dataseed1.binance.org/'); $bnb = new \Binance\Bnb($api); $config = [ 'contract_address' => '0x55d398326f99059ff775485246999027b3197955', // USDT BEP20 'decimals' => 8, ]; $bep20 = new \Binance\BEP20($api, $config); // Transaction transfer (offline signature) $from = '2d24*****630f'; $to = '0x080702F42aeEfF08396E8d2EFCeab8c09a13cdE6'; $amount = 1; $apii = new \Binance\BscscanApi("ZPJP****1E"); $fee = $apii->gasPrice(); $transaction = $bep20->transfer($from, $to, $amount,$fee); var_dump($transaction);This is my code to transfer usdt bep20, but the output is false output => bool(false) @mitmelon can you help in this regard? @Fenguoz @mitmelonThe gas fee is th issue... I forgot how I solved it then... But will check it tomorrow.
Meanwhile trying printing out the gas fee to check if it prints...
I think I have a fork of this where it's solved... Let me check...
thank you Be sure to let me know the result. Thank you
No, there is no problem with the amount of gas, even I set it manually, but the output is still false
<?php error_reporting(E_ALL); require 'Fenguoz-bsc-php/autoload.php'; $api = new \Binance\NodeApi('https://bsc-dataseed1.binance.org/'); $bnb = new \Binance\Bnb($api); $config = [ 'contract_address' => '0x55d398326f99059ff775485246999027b3197955', // USDT BEP20 'decimals' => 8, ]; $bep20 = new \Binance\BEP20($api, $config); // Transaction transfer (offline signature) $from = '2d24*****630f'; $to = '0x080702F42aeEfF08396E8d2EFCeab8c09a13cdE6'; $amount = 1; $apii = new \Binance\BscscanApi("ZPJP****1E"); $fee = $apii->gasPrice(); $transaction = $bep20->transfer($from, $to, $amount,$fee); var_dump($transaction);This is my code to transfer usdt bep20, but the output is false output => bool(false) @mitmelon can you help in this regard? @Fenguoz @mitmelonThe gas fee is th issue... I forgot how I solved it then... But will check it tomorrow. Meanwhile trying printing out the gas fee to check if it prints... I think I have a fork of this where it's solved... Let me check...
thank you Be sure to let me know the result. Thank you
No, there is no problem with the amount of gas, even I set it manually, but the output is still false
Try use the fork here https://github.com/mitmelon/bsc-php and see if it works...
how to use low gas fee?
You can try to print the $res result to see the error message