Giter Site home page Giter Site logo

Comments (22)

Fenguoz avatar Fenguoz commented on August 20, 2024

- *Query information based on transaction hash `getTransactionReceipt(string $txHash)`

from bsc-php.

aliqasemzadeh avatar aliqasemzadeh commented on August 20, 2024

@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.

Fenguoz avatar Fenguoz commented on August 20, 2024

Added getTransactionByHash interface to update the latest package can be used

- *Returns the information about a transaction requested by transaction hash `getTransactionByHash(string $txHash)`

from bsc-php.

aliqasemzadeh avatar aliqasemzadeh commented on August 20, 2024
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.

kendol07 avatar kendol07 commented on August 20, 2024

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.

aliqasemzadeh avatar aliqasemzadeh commented on August 20, 2024

@kendol07
Can you give me ABI decoder?

from bsc-php.

kendol07 avatar kendol07 commented on August 20, 2024

Use this repository that I have created for you: https://github.com/kendol07/eth_abi_decoder".

from bsc-php.

aliqasemzadeh avatar aliqasemzadeh commented on August 20, 2024

@Fenguoz @kendol07
I think we need to add a method that decodes.

from bsc-php.

kendol07 avatar kendol07 commented on August 20, 2024

@Fenguoz if you want you can use my code to implement here.

from bsc-php.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.