diff --git a/contract.go b/contract.go index 11e9e35..17a170f 100644 --- a/contract.go +++ b/contract.go @@ -26,3 +26,12 @@ func (c *Client) ContractSource(address string) (source []ContractSource, err er err = c.call("contract", "getsourcecode", param, &source) return } + +func (c *Client) ContractDeployer(address string) (deployer []ContractDeployer, err error) { + param := M{ + "contractaddresses": address, + } + + err = c.call("contract", "getcontractcreation", param, &deployer) + return +} diff --git a/response.go b/response.go index 5c418cf..408593f 100644 --- a/response.go +++ b/response.go @@ -35,7 +35,7 @@ type NormalTx struct { BlockNumber int `json:"blockNumber,string"` TimeStamp Time `json:"timeStamp"` Hash string `json:"hash"` - Nonce int `json:"nonce,string"` + Nonce int `json:"nonce,string,omitempty"` BlockHash string `json:"blockHash"` TransactionIndex int `json:"transactionIndex,string"` From string `json:"from"` @@ -50,8 +50,8 @@ type NormalTx struct { CumulativeGasUsed int `json:"cumulativeGasUsed,string"` GasUsed int `json:"gasUsed,string"` Confirmations int `json:"confirmations,string"` - FunctionName string `json:"functionName"` - MethodId string `json:"methodId"` + // FunctionName string `json:"functionName"` + // MethodId string `json:"methodId"` } // InternalTx holds info from internal tx query @@ -165,6 +165,11 @@ type ContractSource struct { Implementation string `json:"Implementation"` SwarmSource string `json:"SwarmSource"` } +type ContractDeployer struct { + ContractAddress string `json:"ContractAddress"` + ContractCreator string `json:"ContractCreator"` + TxHash string `json:"TxHash"` +} // ExecutionStatus holds info from query for transaction execution status type ExecutionStatus struct {