Comments (22)
Line 35 in 916a961
from bsc-php.
@Fenguoz
Hi
It didn't get transaction detail when it is token transfer.
my code is:
$uri = 'https://bsc-dataseed1.defibit.io/';// Mainnet
$api = new \Binance\NodeApi($uri);
$config = [
'contract_address' => '0x55d398326f99059ff775485246999027b3197955',// USDT BEP20
'decimals' => 18,
];
$bep20 = new \Binance\BEP20($api, $config);
$txHash = '0x60c6ff9b16ddf2372cb7f8a1c02c990ae5c93162cf0bc8a866000a122dfba401';
var_dump($bep20->getTransactionReceipt($txHash));
output :
array(14) {
["blockHash"]=>
string(66) "0xfaa6ab98a791e6ef6cb70ebc9d611f074325b5550e0fae4972c2a8c1262c8ba7"
["blockNumber"]=>
string(9) "0x1b694c6"
["contractAddress"]=>
NULL
["cumulativeGasUsed"]=>
string(8) "0xb67fb6"
["effectiveGasPrice"]=>
string(10) "0xb2d05e00"
["from"]=>
string(42) "0x392760369e0d81a156d7231a3fe177dba97dd22b"
["gasUsed"]=>
string(6) "0x527b"
["logs"]=>
array(1) {
[0]=>
array(9) {
["address"]=>
string(42) "0x55d398326f99059ff775485246999027b3197955"
["topics"]=>
array(3) {
[0]=>
string(66) "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"
[1]=>
string(66) "0x000000000000000000000000392760369e0d81a156d7231a3fe177dba97dd22b"
[2]=>
string(66) "0x00000000000000000000000065624442e8916b8cd4bc7c57388461bdc1bbe1a6"
}
["data"]=>
string(66) "0x0000000000000000000000000000000000000000000000056bc75e2d63100000"
["blockNumber"]=>
string(9) "0x1b694c6"
["transactionHash"]=>
string(66) "0x60c6ff9b16ddf2372cb7f8a1c02c990ae5c93162cf0bc8a866000a122dfba401"
["transactionIndex"]=>
string(4) "0x6f"
["blockHash"]=>
string(66) "0xfaa6ab98a791e6ef6cb70ebc9d611f074325b5550e0fae4972c2a8c1262c8ba7"
["logIndex"]=>
string(4) "0xcd"
["removed"]=>
bool(false)
}
}
["logsBloom"]=>
string(514) "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010080000000000000001000008000000000000000
000000000000200000000000000400000000000000000000000000000000000000000000000000010000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000020000000000000000000200000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000"
["status"]=>
string(3) "0x1"
["to"]=>
string(42) "0x55d398326f99059ff775485246999027b3197955"
["transactionHash"]=>
string(66) "0x60c6ff9b16ddf2372cb7f8a1c02c990ae5c93162cf0bc8a866000a122dfba401"
["transactionIndex"]=>
string(4) "0x6f"
["type"]=>
string(3) "0x0"
}
There is no detail about the amount and which address get tokens.
from bsc-php.
Added getTransactionByHash
interface to update the latest package can be used
Line 36 in b6d72bb
from bsc-php.
array(15) {
["blockHash"]=>
string(66) "0xfaa6ab98a791e6ef6cb70ebc9d611f074325b5550e0fae4972c2a8c1262c8ba7"
["blockNumber"]=>
string(9) "0x1b694c6"
["from"]=>
string(42) "0x392760369e0d81a156d7231a3fe177dba97dd22b"
["gas"]=>
string(7) "0x30d40"
["gasPrice"]=>
string(10) "0xb2d05e00"
["hash"]=>
string(66) "0x60c6ff9b16ddf2372cb7f8a1c02c990ae5c93162cf0bc8a866000a122dfba401"
["input"]=>
string(138) "0xa9059cbb00000000000000000000000065624442e8916b8cd4bc7c57388461bdc1bbe1a60000000000000000000000000000000000000000000000056bc75e2d63100000"
["nonce"]=>
string(5) "0x3ee"
["to"]=>
string(42) "0x55d398326f99059ff775485246999027b3197955"
["transactionIndex"]=>
string(4) "0x6f"
["value"]=>
string(3) "0x0"
["type"]=>
string(3) "0x0"
["v"]=>
string(4) "0x93"
["r"]=>
string(66) "0x1c59dfc1ab96126010300040e451375aaa13b15f86930df72e3fe09b2928a951"
["s"]=>
string(66) "0x44b25765a3268e457013ec144caa6532d476aae17f96a84449155527dfbdced1"
}
Yet no detail about token transaction.
from bsc-php.
You must decode this,
Here are the details of the token transaction.
["input"]=>
string(138) "0xa9059cbb00000000000000000000000065624442e8916b8cd4bc7c57388461bdc1bbe1a60000000000000000000000000000000000000000000000056bc75e2d63100000"
This part refers to the token contract address: USDT
["to"]=>
string(42) "0x55d398326f99059ff775485246999027b3197955"
You need to decode the 'input' using an 'ABI' decoder.
from bsc-php.
@kendol07
Can you give me ABI decoder?
from bsc-php.
Use this repository that I have created for you: https://github.com/kendol07/eth_abi_decoder".
from bsc-php.
@Fenguoz @kendol07
I think we need to add a method that decodes.
from bsc-php.
@Fenguoz if you want you can use my code to implement here.
from bsc-php.
Related Issues (11)
- sop/asn1 update needed HOT 7
- Transfer not working HOT 4
- Error During BEP20 Transfer HOT 1
- Donations
- the same private key is always displayed HOT 4
- BNB Transfer HOT 4
- Do we need API Key to use this package? HOT 6
- NULL Response BSC HOT 1
- new Address by private key HOT 1
- i face following problem when transfer BEP20 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bsc-php.