Fenguoz / bsc-php

Support Binance Smart Chain BNB/BEP20 digital assets, including address creation, balance query, transaction transfer, query the latest blockchain, query information based on blockchain, query information based on transaction hash, etc.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Transfer not working

mitmelon opened this issue · comments

The transfer is not working...

 $uri = 'https://data-seed-prebsc-1-s1.binance.org:8545/';// Testnet
    $api = new \Binance\NodeApi($uri);
    $bnb = new \Binance\Bnb($api);
    $config = [
        'contract_address' => '0xA874AE9a50a1a9A4A21285AB188E324bb4b3fA2A',// USDT BEP20
        'decimals' => 8,
    ];
    $bep20 = new \Binance\BEP20($api, $config);
    
    $from = 'PRIVATE_KEY';
    $to = '0xebccc7556e93d16a95c6abcee1cd0586949b3c1f';
    $amount = 0.1;
    $f = $bep20->transfer($from, $to, $amount);
    var_dump($f);

returning false;

Hi, try to send gasPrice as 4th argument for transfer(). You can get it from like this:

$api = new \Binance\BscscanApi($apiKey);
$fee = $api->gasPrice();

Hi, try to send gasPrice as 4th argument for transfer(). You can get it from like this:

$api = new \Binance\BscscanApi($apiKey);
$fee = $api->gasPrice();

好像也不行,我转账的是bnb,也是出现燃料不足,不知道楼主的解决没

Hi, try to send gasPrice as 4th argument for transfer(). You can get it from like this:

$api = new \Binance\BscscanApi($apiKey);
$fee = $api->gasPrice();

好像也不行,我转账的是bnb,也是出现燃料不足,不知道楼主的解决没

It works

Hi, try to send gasPrice as 4th argument for transfer(). You can get it from like this:

$api = new \Binance\BscscanApi($apiKey);
$fee = $api->gasPrice();

好像也不行,我转账的是bnb,也是出现燃料不足,不知道楼主的解决没

It works

可以了,谢谢