Documentation
¶
Index ¶
- Constants
- func Call(client *ethclient.Client, toAddress common.Address, data []byte) ([]byte, error)
- func Execute() error
- func GenRawTx(signedTx *types.Transaction) (string, error)
- func InitGlobalClient(nodeUrl string)
- func RecoverPubkey(v, r, s *big.Int, msg []byte) ([]byte, error)
- func SendRawTransaction(rpcClient *rpc.Client, signedTx *types.Transaction) (*common.Hash, error)
- func Transact(rpcClient *rpc.Client, client *ethclient.Client, privateKey *ecdsa.PrivateKey, ...) (string, error)
- func TransferHelper(rcpClient *rpc.Client, client *ethclient.Client, privateKeyHex string, ...) (string, error)
- type AbiData
- type AbiJSONData
- type Client
- type GasStationPrice
Constants ¶
View Source
const EthGasStationUrl = "https://ethgasstation.info/json/ethgasAPI.json"
Variables ¶
This section is empty.
Functions ¶
func GenRawTx ¶
func GenRawTx(signedTx *types.Transaction) (string, error)
GenRawTx return raw tx, a hex string with 0x prefix
func InitGlobalClient ¶
func InitGlobalClient(nodeUrl string)
InitGlobalClient initializes a client that uses the given RPC client.
func RecoverPubkey ¶
RecoverPubkey recover public key, returns 65 bytes uncompressed public key
func SendRawTransaction ¶
SendRawTransaction broadcast signed tx and return tx returned by rpc node
Types ¶
type AbiData ¶
type AbiData struct {
Inputs []struct {
Name string `json:"name"`
Type string `json:"type"`
} `json:"inputs"`
Name string `json:"name"`
Type string `json:"type"` // constructor, function, etc.
Outputs []struct {
Name string `json:"name"`
Type string `json:"type"`
} `json:"outputs"`
}
ABI example: [
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"internalType": "uint256[]",
"name": "_a",
"type": "uint256[]"
},
{
"internalType": "address[]",
"name": "_addr",
"type": "address[]"
}
],
"name": "f1",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "f2",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
...... ]
type AbiJSONData ¶
type AbiJSONData struct {
ABI []AbiData `json:"abi"`
}
Click to show internal directories.
Click to hide internal directories.