如何使用RPC / web3 / ether.js识别以太坊智能合约转让?

问题描述 投票:0回答:1

如果

1)钱包A转移1以太币到智能合约B.

并在同一时间

2)智能合约B将以太币转移到钱包C

A-> B-> C ^

使用eth_getTransactionReceipt,如何检查已发送到钱包C的金额?

blockchain ethereum web3 ether
1个回答
1
投票

要使用eth_getTransactionReceipt方法,您需要b - > c传输的TX编号。您可以通过各种方式获得TX,但发出事件通常是您如何做到的。获得TX后,您可以拨打以下电话:

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["<TX number goes here>"],"id":1}'

链接自:https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_gettransactionreceipt

© www.soinside.com 2019 - 2024. All rights reserved.