Versions in this module Expand all Collapse all v0 v0.1.0 Aug 4, 2022 Changes in this version + var UnitBabbage = new(big.Int).Mul(UnitWei, big.NewInt(1000)) + var UnitEther = new(big.Int).Mul(UnitFinney, big.NewInt(1000)) + var UnitFinney = new(big.Int).Mul(UnitSzabo, big.NewInt(1000)) + var UnitGrand = new(big.Int).Mul(UnitEther, big.NewInt(1000)) + var UnitLovelace = new(big.Int).Mul(UnitBabbage, big.NewInt(1000)) + var UnitMegaether = new(big.Int).Mul(UnitGrand, big.NewInt(1000)) + var UnitShannon = new(big.Int).Mul(UnitLovelace, big.NewInt(1000)) + var UnitSzabo = new(big.Int).Mul(UnitShannon, big.NewInt(1000)) + var UnitWei = big.NewInt(1) + func ConvHexToBigInt(raw any) (bi *big.Int, err error) + func ConvHexToUint64(raw any) (uint64, error) + func MustConvHexToBigInt(raw any) *big.Int + func MustConvHexToUint64(raw any) uint64 + type ChainClient struct + ChainID *big.Int + PrivateKey *ecdsa.PrivateKey + RPCClient *Client + URL string + func NewChainClient(c *Client, url string, privateKey *ecdsa.PrivateKey, chainID *big.Int) *ChainClient + func (cc *ChainClient) GetTxReceipt(hash string) (*RawTxReceipt, error) + func (cc *ChainClient) SendTx(txdata ethtypes.TxData) (*RPCResp, error) + type Client struct + func NewClient() *Client + func (c *Client) BuildRequest(method string, params []any) *RPCReq + func (c *Client) Inc() uint64 + func (c *Client) MakeRequest(url, method string, params []any) (*RPCResp, error) + func (c *Client) MakeRequestBatch(url string, methods []string, params [][]any) ([]RPCResp, error) + func (c *Client) MakeRequestBatchGenric(url string, methods []string, params [][]any, r any) error + func (c *Client) SendTx(url string, txdata ethtypes.TxData, privateKey *ecdsa.PrivateKey, ...) (*RPCResp, error) + func (c *Client) SendTxSimple(pk string, value *big.Int, gasPrice *big.Int, toAddress string, nonce uint64, ...) error + func (c *Client) SetAuth(auth string) + func (c *Client) SetKeepAlive(shouldKeepAlive bool) + func (c *Client) SetProxy(proxy, proxyAuth string) + func (c *Client) SetTimeout(duration time.Duration) + type RPCBase struct + ID uint64 + JSONRPC string + type RPCBlockResp struct + Error RPCError + Result RawBlockResponse + type RPCError struct + Code int64 + Data any + Message string + type RPCReceiptResp struct + Error RPCError + Result RawTxReceipt + type RPCReq struct + Method string + Params []any + type RPCResp struct + Error RPCError + Result any + type RawBlockResponse struct + BaseFeePerGas RawQuantityResponse + Difficulty RawQuantityResponse + ExtraData RawDataResponse + GasLimit RawQuantityResponse + GasUsed RawQuantityResponse + Hash RawData32Response + LogsBloom RawData256Response + Miner RawData20Response + Nonce RawData8Response + Number RawQuantityResponse + ParentHash RawData32Response + ReceiptsRoot RawData32Response + SHA3Uncles RawData32Response + Size RawQuantityResponse + StateRoot RawData32Response + Timestamp RawQuantityResponse + TotalDifficulty RawQuantityResponse + Transactions []RawTransactionResponse + TransactionsRoot RawData32Response + Uncles []RawQuantityResponse + func NewRawBlockResponseFromAny(raw any) (*RawBlockResponse, error) + type RawData20Response string + type RawData256Response string + type RawData32Response string + type RawData8Response string + type RawDataResponse string + type RawQuantityResponse string + func (r RawQuantityResponse) ToInt64() int64 + func (r RawQuantityResponse) ToUint64() uint64 + type RawTransactionResponse struct + BlockHash RawData32Response + BlockNumber RawQuantityResponse + From RawData20Response + Gas RawQuantityResponse + GasPrice RawQuantityResponse + Hash RawData32Response + Input RawDataResponse + Nonce RawQuantityResponse + R RawQuantityResponse + S RawQuantityResponse + To RawData20Response + TransactionIndex RawQuantityResponse + V RawQuantityResponse + Value RawQuantityResponse + type RawTxReceipt struct + BlockHash RawData32Response + BlockNumber RawQuantityResponse + ContractAddress RawData20Response + CumulativeGasUsed RawQuantityResponse + From RawData20Response + GasUsed RawQuantityResponse + Logs []RawDataResponse + LogsBloom RawData256Response + Root RawData32Response + Status RawQuantityResponse + To RawDataResponse + TransactionHash RawData32Response + TransactionIndex RawQuantityResponse