Transaction Monitoring
Query Transaction ActionsTry API
POST
chain_tvm
(Query Transaction Actions)
This action is usually executed periodically by the wallet backend. It traverses on-chain transaction data and records transfers related to the current registration information.
Return Values
type TransItem struct {
From string json:"from"
To string json:"to"
Funccode string json:"funccode" //contracttransactionfunctioncode
Data string json:"data" //contracttransactioncountaccording to
Amount uint64 json:"amount" //platform coinamount
High uint64 json:"high" //height
Txhash string json:"txhash" //transactionhash
}
Example Code
{
"jsonrpc": "3.0",
"method": "chain_tvm",
"params": [
"opcode=token&subcode=scanBlock&sliceno=0",
"encryp=none"
],
"id": "aa80aa0c6bb0c7d81ac7e5b3"
}{
"jsonrpc": "3.0",
"id": "aa80aa0c6bb0c7d81ac7e5b3",
"result": {
"ret": "0",
"err": "",
"content": {
}
}
}{
"jsonrpc": "3.0",
"id": "1",
"result": {
"ret": "0",
"err": "",
"content": [
{
"parenthash": "0xcfee308a28697bafef2f635c2c67272a65eab1996c93aebac2bcb29155d5bc77",
"miner": "0x6d3da5167929a4b297df09325389d72f35327fa4",
"stateRoot": "0x670a4e6f9262854a889e36dd766c6942780a6a9c74840fcbe2a9fde1e4f2c36b",
"transactionsRoot": "0xb0ef76de17cce27b75554325e7cba7f22eb3238fb642f35b174c885ae86f1987",
"receiptsRoot": "0xbc86b068c10758ec5e644d81b530038b31e6da3450892c7a3dcb6e9a0488c1e8",
"Recno": 2,
"number": 1,
"timestamp": 1742515456744655700,
"Txns": [
//transactionhash "0xd56f8fd299e309598752d54576395f15d403f2eb274d163e4eaf9e103cf64828"
],
"Senders": [
//transactionsubmitperson "0x35f4646842fc5fe208b7d3fab125c8542be88324"
],
"Data": "" //transactioncontent,
base64encodedtransactioncontentexpandafter,
eachtransactionparse: From: from "Senders"array in correspondingindexgetto Value: ifhasvalue,
descriptionis platform cointransferInput: ifvalueempty,
inputhascontent,
thatthenis contracttransactionERC20contracttokenthreere-need tofunctionparse: transfer: function transfer(address _to,
uint256 _value)external returns (bool success)functioncode: 0xa9059cbbparameterformat: 264charactersstringfor example: 000000000000000000000000fa363a25864e3557c62b25cc41ccff4b41c6d7620000000000000000000000000000000000000000000000000000000000000030completecontent: 0xa9059cbb000000000000000000000000fa363a25864e3557c62b25cc41ccff4b41c6d7620000000000000000000000000000000000000000000000000000000000000030delegatetransfer: function transferFrom(address _from,
address _to,
uint256 _value)external returns (bool success)functioncode: 0x23b872ddparameterformat: 364charactersstringfor example: 000000000000000000000000fa363a25864e3557c62b25cc41ccff4b41c6d762000000000000000000000000ca363a25864e3557c62b25cc41ccff4b41c6d7680000000000000000000000000000000000000000000000000000000000000030 completecontent: formatsame as abovedelegateamount: function approve(address _spender,
uint256 _value)external returns (bool success)functioncode: 0x095ea7b3parameterformat: 264charactersstringfor example: 000000000000000000000000fa363a25864e3557c62b25cc41ccff4b41c6d7620000000000000000000000000000000000000000000000000000000000000030completecontent: formatsame as above