Documentation ¶
Overview ¶
xk6 build --with github.com/distribworks/xk6-ethereum=.
xk6 build --with github.com/grafana/xk6-ethereum=.
Index ¶
- func PrivateKeyToHexString(privateKey *ecdsa.PrivateKey) string
- func PublicKeyToHexString(publicKey *ecdsa.PublicKey) string
- type Client
- func (c *Client) Accounts() ([]string, error)
- func (c *Client) BlockNumber() (uint64, error)
- func (c *Client) Call(method string, params ...interface{}) (interface{}, error)
- func (c *Client) DeployContract(abistr string, bytecode string, args ...interface{}) (*ethgo.Receipt, error)
- func (c *Client) EstimateGas(tx Transaction) (uint64, error)
- func (c *Client) Exports() modules.Exports
- func (c *Client) GasPrice() (uint64, error)
- func (c *Client) GetBalance(address string, blockNumber ethgo.BlockNumber) (uint64, error)
- func (c *Client) GetBlockByNumber(number ethgo.BlockNumber, full bool) (*ethgo.Block, error)
- func (c *Client) GetNonce(address string) (uint64, error)
- func (c *Client) GetTransactionReceipt(hash string) (*ethgo.Receipt, error)
- func (c *Client) NewContract(address string, abistr string) (*Contract, error)
- func (c *Client) SendRawTransaction(tx Transaction) (string, error)
- func (c *Client) SendTransaction(tx Transaction) (string, error)
- func (c *Client) WaitForTransactionReceipt(hash string) *sobek.Promise
- type Contract
- type EthRoot
- type Key
- type ModuleInstance
- type Transaction
- type TxnOpts
- type Wallet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrivateKeyToHexString ¶ added in v1.0.1
func PrivateKeyToHexString(privateKey *ecdsa.PrivateKey) string
PrivateKeyToHexString converts a go-ethereum private key to its hexadecimal string representation.
func PublicKeyToHexString ¶ added in v1.0.1
PublicKeyToHexString converts a go-ethereum public key to its hexadecimal string representation.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Accounts ¶
Accounts returns a list of addresses owned by client. This endpoint is not enabled in infrastructure providers.
func (*Client) BlockNumber ¶
BlockNumber returns the current block number.
func (*Client) DeployContract ¶
func (c *Client) DeployContract(abistr string, bytecode string, args ...interface{}) (*ethgo.Receipt, error)
DeployContract deploys a contract to the blockchain.
func (*Client) EstimateGas ¶
func (c *Client) EstimateGas(tx Transaction) (uint64, error)
EstimateGas returns the estimated gas for the given transaction.
func (*Client) GetBalance ¶
func (*Client) GetBlockByNumber ¶
GetBlockByNumber returns the block with the given block number.
func (*Client) GetTransactionReceipt ¶
GetTransactionReceipt returns the transaction receipt for the given transaction hash.
func (*Client) NewContract ¶
NewContract creates a new contract instance with the given ABI.
func (*Client) SendRawTransaction ¶
func (c *Client) SendRawTransaction(tx Transaction) (string, error)
SendRawTransaction signs and sends transaction to the network.
func (*Client) SendTransaction ¶
func (c *Client) SendTransaction(tx Transaction) (string, error)
SendTransaction sends a transaction to the network.
type Contract ¶
Contract exposes a contract
type ModuleInstance ¶
type ModuleInstance struct {
// contains filtered or unexported fields
}
func (*ModuleInstance) Exports ¶
func (mi *ModuleInstance) Exports() modules.Exports
Exports implements the modules.Instance interface and returns the exported types for the JS module.
func (*ModuleInstance) NewClient ¶
func (mi *ModuleInstance) NewClient(call sobek.ConstructorCall) *sobek.Object