Skip to content

Commit cc7d16d

Browse files
authored
txlistinternal by hash
1 parent 07a1d97 commit cc7d16d

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

account.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ func (c *Client) InternalTxByAddress(address string, startBlock *int, endBlock *
7575
return
7676
}
7777

78+
// InternalTxByTxHash gets a list of "internal" transactions by address
79+
func (c *Client) InternalTxByTxHash(txHash string) (txs []InternalTxByHash, err error) {
80+
param := M{
81+
"txhash": txHash,
82+
}
83+
err = c.call("account", "txlistinternal", param, &txs)
84+
return
85+
}
86+
7887
// ERC20Transfers get a list of "erc20 - token transfer events" by
7988
// contract address and/or from/to address.
8089
//

response.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,22 @@ type InternalTx struct {
7070
ErrCode string `json:"errCode"`
7171
}
7272

73+
// InternalTxByHash holds info from internal tx query
74+
type InternalTxByHash struct {
75+
BlockNumber int `json:"blockNumber,string"`
76+
TimeStamp Time `json:"timeStamp"`
77+
From string `json:"from"`
78+
To string `json:"to"`
79+
Value *BigInt `json:"value"`
80+
ContractAddress string `json:"contractAddress"`
81+
Input string `json:"input"`
82+
Type string `json:"type"`
83+
Gas int `json:"gas,string"`
84+
GasUsed int `json:"gasUsed,string"`
85+
IsError int `json:"isError,string"`
86+
ErrCode string `json:"errCode"`
87+
}
88+
7389
// ERC20Transfer holds info from ERC20 token transfer event query
7490
type ERC20Transfer struct {
7591
BlockNumber int `json:"blockNumber,string"`

0 commit comments

Comments
 (0)