seth

package module
v0.0.0-...-d48d2ef Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2018 License: MIT Imports: 41 Imported by: 7

README

Build Status

Seth

The Simple Ethereum Client

Documentation

Index

Constants

View Source
const (
	Pending  = int64(-2) // Pending block.
	Latest   = int64(-1) // Latest block.
	Earliest = int64(0)  // Earliest block.
)

Block specifiers.

Variables

View Source
var (
	// ERC20Transfer is hash of the canonical ERC20 Transfer event
	ERC20Transfer = HashString("Transfer(address,address,uint256)")
	// ERC20Approve is the hash of the canonical ERC20 Approve event
	ERC20Approve = HashString("Approval(address,address,uint256)")
)
View Source
var ErrCannotCancel = errors.New("seth: cannot cancel")

ErrCannotCancel is returned when attempting to cancel a transaction that has already been mined.

View Source
var ErrNotFound = errors.New("seth: not found")
View Source
var PasswordDenied = errors.New("password denied")

Functions

func ABIEncode

func ABIEncode(fn string, args ...EtherType) []byte

ABIEncode encodes a function and its arguments

func CurvePoint

func CurvePoint(x *big.Int, y *big.Int, v int)

CurvePoint takes the x-coordinate of a secp256k1 curve point and computes the corresponding y-coordinate. "v" should indicate the low bit of the y-coordinate.

func DecodeABI

func DecodeABI(v []byte, args ...interface{}) error

DecodeABI decodes a solidity return value into its constituent arguments.

NOTE: Not all values are supported. Currently, supported types are:

  • integers -> all Go integer types, plus big.Int and seth.Int
  • bool -> bool
  • string -> string
  • address -> seth.Address
  • uint256[] -> seth.IntSlice
  • address[] -> seth.AddrSlice
  • bytes32[] -> seth.DataSlice
  • bytes -> []byte or seth.Bytes

func IPCDial

func IPCDial() (io.ReadWriteCloser, error)

IPCDial dials geth over local IPC

It can be used in NewClient like

NewClient(IPCDial)

func IPCPath

func IPCPath(s string) func() (io.ReadWriteCloser, error)

IPCPath returns a closure that dials a unix socket.

It can be used in NewClient like

NewClient(IPCPath("/path/to/geth.ipc"))

func MetadataHash

func MetadataHash(b []byte) []byte

MetadataHash tries to return the portion of a compiled solidity contract that represents the hash of the metadata. If the metadata can't be found, a nil slice is returned.

func RegisterHSM

func RegisterHSM(name string, probe func(hints ...string) HSM)

RegisterHSM registers an HSM under a name and a function to probe if the HSM is installed. The probe function can take hints passed from FindHSM to help it locate the module.

func SignTransaction

func SignTransaction(t *Transaction, sign Signer) ([]byte, error)

SignTransaction produces a signed, serialized 'raw' transaction from the given transaction and signer.

func StripBytecode

func StripBytecode(b []byte) []byte

StripBytecode returns the portion of the bytecode that isn't solidity metadata. If no solidity metadata is present, the argument is returned unchanged.

Types

type ABIDecoder

type ABIDecoder []interface{}

ABIDecoder is an encoding.TextUnmarshaler that can unpack a JSON-RPC response into its constituent solidity arugments.

func NewABIDecoder

func NewABIDecoder(args ...interface{}) *ABIDecoder

NewABIDecoder constructs an ABIDecoder whose implementation of encoding.TextUnmarshaler unpacks arguments into the provided arguments.

func (*ABIDecoder) UnmarshalText

func (d *ABIDecoder) UnmarshalText(v []byte) error

UnmarshalText implements encoding.TextUnmarshaler

type ABIDescriptor

type ABIDescriptor struct {
	// one of "function" "constructor" "fallback" "event"
	Type       string     `json:"type" msg:"name"`
	Name       string     `json:"name" msg:"name"`
	Inputs     []ABIParam `json:"inputs" msg:"inputs"`
	Outputs    []ABIParam `json:"outputs,omitempty" msg:"outputs"`
	Payable    bool       `json:"payable" msg:"payable"`
	Mutability string     `json:"stateMutability" msg:"stateMutability"` // "pure", "view", "nonpayable", "payable"
	Constant   bool       `json:"constant" msg:"constant"`               // either "pure" or "view"
	Anonymous  bool       `json:"anonymous" msg:"anonymous"`
}

ABIDescriptor describes a function, constructor, or event

func (*ABIDescriptor) DecodeMsg

func (z *ABIDescriptor) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*ABIDescriptor) EncodeMsg

func (z *ABIDescriptor) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*ABIDescriptor) MarshalMsg

func (z *ABIDescriptor) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*ABIDescriptor) Msgsize

func (z *ABIDescriptor) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*ABIDescriptor) Signature

func (d *ABIDescriptor) Signature() string

Signature returns the canonical function/event signature. For functions, the first 4 bytes of the hash of the signature is the function selector, and for events, the hash of the signature is the first topic in the log.

func (*ABIDescriptor) UnmarshalMsg

func (z *ABIDescriptor) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type ABIParam

type ABIParam struct {
	Name       string     `json:"name" msg:"name"`
	Type       string     `json:"type" msg:"type"`
	Components []ABIParam `json:"components,omitempty" msg:"componenets"` // for tuples, nested parameters
	Indexed    bool       `json:"indexed" msg:"indexed"`                  // for events, whether or not the parameter is indexed
}

ABIParam describes an input or output parameter to an ABIDescriptor

func (*ABIParam) DecodeMsg

func (z *ABIParam) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*ABIParam) EncodeMsg

func (z *ABIParam) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*ABIParam) MarshalMsg

func (z *ABIParam) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*ABIParam) Msgsize

func (z *ABIParam) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*ABIParam) UnmarshalMsg

func (z *ABIParam) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type AddrSlice

type AddrSlice []Address

AddrSlice is an implementation of EtherSlice for a list of addresses

func (*AddrSlice) EncodeABI

func (a *AddrSlice) EncodeABI(v []byte) []byte

func (*AddrSlice) Len

func (a *AddrSlice) Len() int

Len implements EtherSlice.Len

type Address

type Address [20]byte

Address represent an Ethereum address

func ParseAddress

func ParseAddress(s string) (*Address, error)

ParseAddress parses an address.

func (*Address) DecodeMsg

func (z *Address) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*Address) EncodeABI

func (a *Address) EncodeABI(v []byte) []byte

EncodeABI implements EtherType

func (*Address) EncodeMsg

func (z *Address) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*Address) FromString

func (a *Address) FromString(s string) error

func (*Address) MarshalMsg

func (z *Address) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (Address) MarshalText

func (a Address) MarshalText() ([]byte, error)

func (*Address) Msgsize

func (z *Address) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Address) Scan

func (a *Address) Scan(s fmt.ScanState, x rune) error

Scan implements fmt.Scanner (uses the verb %a)

func (*Address) String

func (a *Address) String() string

func (*Address) UnmarshalMsg

func (z *Address) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*Address) UnmarshalText

func (a *Address) UnmarshalText(b []byte) error

func (*Address) Zero

func (a *Address) Zero() bool

Zero returns whether this is the zero address.

type Block

type Block struct {
	Number          *Uint64           `json:"number"`     // block number, or nil if pending
	Hash            *Hash             `json:"hash"`       // block hash, or nil if pending
	Parent          Hash              `json:"parentHash"` // parent block hash
	Nonce           Uint64            `json:"nonce"`
	UncleHash       Hash              `json:"sha3Uncles"`          // hash of uncles in block
	Bloom           Data              `json:"logsBloom,omitempty"` // bloom filter of logs, or nil if pending
	TxRoot          Hash              `json:"transactionsRoot"`    // root of transaction trie of block
	StateRoot       Hash              `json:"stateRoot"`           // root of final state trie of block
	ReceiptsRoot    Hash              `json:"receiptsRoot"`        // root of receipts trie of block
	Miner           Address           `json:"miner"`
	GasLimit        Uint64            `json:"gasLimit"`
	GasUsed         Uint64            `json:"gasUsed"`
	Transactions    []json.RawMessage `json:"transactions"` // transactions; either hex strings of hashes, or actual tx bodies
	Uncles          []Hash            `json:"uncles"`       // array of uncle hashes
	Difficulty      *Int              `json:"difficulty"`
	TotalDifficulty *Int              `json:"totalDifficulty"`
	Timestamp       Uint64            `json:"timestamp"`
	Extra           Data              `json:"extraData,omitempty"`
}

Block represents and Ethereum block

func (*Block) DecodeMsg

func (z *Block) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*Block) EncodeMsg

func (z *Block) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*Block) MarshalMsg

func (z *Block) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Block) Msgsize

func (z *Block) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Block) ParseTransactions

func (b *Block) ParseTransactions() ([]Transaction, error)

Transactions returns the list of block transactions, given that b.Transactions is a set of serialized transactions, and not just a set of tx hashes.

func (*Block) Time

func (b *Block) Time() time.Time

Time turns the block timestamp into a time.Time

func (*Block) UnmarshalMsg

func (z *Block) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type BlockIterator

type BlockIterator struct {
	// contains filtered or unexported fields
}

BlockIterator manages a channel that yields blocks in block number order.

func (*BlockIterator) DecodeMsg

func (z *BlockIterator) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (BlockIterator) EncodeMsg

func (z BlockIterator) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (BlockIterator) MarshalMsg

func (z BlockIterator) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (BlockIterator) Msgsize

func (z BlockIterator) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*BlockIterator) Next

func (b *BlockIterator) Next() <-chan *Block

Next returns the next block in the chain. The channel will be closed when Stop() is called.

func (*BlockIterator) Stop

func (b *BlockIterator) Stop()

Stop causes the block itertation to stop. It should only be called once.

func (*BlockIterator) UnmarshalMsg

func (z *BlockIterator) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Bytes

type Bytes []byte

Bytes is like Data, but can be be greater than 32 bytes in length

func (*Bytes) EncodeABI

func (b *Bytes) EncodeABI(v []byte) []byte

EncodeABI implements EtherType.EncodeABI

func (*Bytes) Len

func (b *Bytes) Len() int

Len implements EtherSlice.Len

func (Bytes) MarshalText

func (b Bytes) MarshalText() ([]byte, error)

func (*Bytes) String

func (b *Bytes) String() string

func (*Bytes) UnmarshalText

func (b *Bytes) UnmarshalText(bx []byte) error

type CallOpts

type CallOpts struct {
	From     *Address `json:"from,omitempty"`     // Sender address
	To       *Address `json:"to,omitempty"`       // Contract address
	Gas      *Int     `json:"gas,omitempty"`      // Gas offered for call
	GasPrice *Int     `json:"gasPrice,omitempty"` // GasPrice offered for gas
	Value    *Int     `json:"value,omitempty"`    // Value to send
	Data     Data     `json:"data"`               // Input to the call
	Nonce    *Uint64  `json:"nonce,omitempty"`    // Nonce of the call
}

CallOpts describes a transaction (contract call).

func (*CallOpts) EncodeCall

func (c *CallOpts) EncodeCall(fn string, args ...EtherType)

EncodeCall sets up c.Data so that it reflects the given function signature and argument list.

EncodeCall does some rudimentary sanity checking on the provided arguments and panics if the function signature string or argument list is malformed. For instance, for a function signature of "transfer(address,uint256)", EncodeCall would panic if two arguments weren't provided, or if they weren't an *Address and *Int, respectively.

func (*CallOpts) Transaction

func (o *CallOpts) Transaction() *Transaction

Transaction returns a transaction structure representing this call.

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(dial func() (io.ReadWriteCloser, error)) *Client

func NewClientTransport

func NewClientTransport(tp Transport) *Client

func NewHTTPClient

func NewHTTPClient(url string) *Client

func (*Client) Accounts

func (c *Client) Accounts() ([]Address, error)

Accounts gets the accounts owned by the client.

func (*Client) BlockNumber

func (c *Client) BlockNumber() (int64, error)

BlockNumber gets the number of the most recent block.

func (*Client) Call

func (c *Client) Call(opts *CallOpts) (tx Hash, err error)

Call makes a transaction call using the given CallOpts.

func (*Client) Coinbase

func (c *Client) Coinbase() (*Address, error)

Coinbase returns the client coinbase address.

func (*Client) ConstCall

func (c *Client) ConstCall(opts *CallOpts, out interface{}, pending bool) error

ConstCall executes an EVM call without mining a transaction into the blockchain. If 'pending' is true, the transaction is executed in the pending block; otherwise the call is executed in the latest block. 'out' should be a type that can be unmarshaled from the JSON representation of the return value of the function.

func (*Client) ConstCallAt

func (c *Client) ConstCallAt(opts *CallOpts, out interface{}, block int64) error

ConstCallAt executes a call in the given block.

func (*Client) DecodeMsg

func (z *Client) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*Client) Do

func (c *Client) Do(method string, params []json.RawMessage, result interface{}) error

Do makes a raw rpc request; it does not interpret the method or param strings, and tries to unmarshal the result directly into "result." Use another method instead, if you can.

func (Client) EncodeMsg

func (z Client) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*Client) EstimateGas

func (c *Client) EstimateGas(opts *CallOpts) (gas Int, err error)

EstimateGas estimates the gas cost of mining this call into the blockchain.

func (*Client) FilterTopics

func (c *Client) FilterTopics(topics []*Hash, addr *Address, start, end int64) (*Filter, error)

FilterTopics creates a log filter that matches the given topics. (Topics are order-dependent.) If 'addr' is non-nil, only logs generated from that address are yielded by the filter. If 'start' and 'end' are non-negative, then they specify the range of blocks in which to search. Otherwise, the filter starts at the latest block.

func (*Client) GasPrice

func (c *Client) GasPrice() (int64, error)

GasPrice gets the gas price in wei.

func (*Client) GetBalance

func (c *Client) GetBalance(addr *Address) (Int, error)

GetBalance gets the balance of an address in wei at the latest block.

func (*Client) GetBalanceAt

func (c *Client) GetBalanceAt(addr *Address, blocknum int64) (Int, error)

GetBalanceAt gets the balance for a specific address and at a specific block number.

func (*Client) GetBlock

func (c *Client) GetBlock(num int64, txs bool) (*Block, error)

GetBlock gets a block by block number. If 'txs' is true, the block includes all the transactions in the block; otherwise it only includes the transaction hashes.

func (*Client) GetCode

func (c *Client) GetCode(addr *Address) ([]byte, error)

GetCode gets the code for the given address in the latest block.

func (*Client) GetCodeAt

func (c *Client) GetCodeAt(addr *Address, blocknum int64) ([]byte, error)

GetCodeAt gets the code for the given address at the given block.

func (*Client) GetNonce

func (c *Client) GetNonce(addr *Address) (int64, error)

GetNonce gets the account nonce for an address in the latest block.

func (*Client) GetNonceAt

func (c *Client) GetNonceAt(addr *Address, blocknum int64) (int64, error)

GetNonceAt gets the account nonce for a specific address and at a specific block number.

func (*Client) GetReceipt

func (c *Client) GetReceipt(tx *Hash) (*Receipt, error)

GetReceipt gets a receipt for a given transaction hash.

func (*Client) GetTransaction

func (c *Client) GetTransaction(h *Hash) (*Transaction, error)

GetTransaction gets a transaction by its hash

func (*Client) Hashrate

func (c *Client) Hashrate() (int64, error)

Hashrate gets the number of hashes per second that the node is mining with.

func (*Client) IterateBlocks

func (c *Client) IterateBlocks(from int64, txs bool) *BlockIterator

IterateBlocks creates a BlockIterator that starts at the given block number.

func (*Client) Latest

func (c *Client) Latest(txs bool) (*Block, error)

Latest returns the latest block

func (Client) MarshalMsg

func (z Client) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Client) Mining

func (c *Client) Mining() (bool, error)

Mining returns whether the node is actively mining blocks.

func (Client) Msgsize

func (z Client) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Client) Pending

func (c *Client) Pending() ([]Transaction, error)

Pending returns the list of pending transactions.

func (*Client) ProtocolVersion

func (c *Client) ProtocolVersion() (string, error)

ProtocolVersion gets the protocol version of the node.

func (*Client) RawCall

func (c *Client) RawCall(raw []byte) (tx Hash, err error)

RawCall makes a transaction call using the given CallOpts.

func (*Client) StorageAt

func (c *Client) StorageAt(addr *Address, offset *Hash, block int64) (Hash, error)

StorageAt reads contract storage from a contract at a particular 256-bit address.

func (*Client) Syncing

func (c *Client) Syncing() (*SyncStatus, error)

Syncing returns the syncing status of the node, or nil if not syncing.

func (*Client) TokenTransfers

func (c *Client) TokenTransfers(from *Address, to *Address, tok *Address, start, end int64) (*Filter, error)

TokenTransfers returns a filter that searches for token transfers matching the given arguments. If any of the argments are nil, the filter matches that argument as a wildcard. In other words, if from, to, and tok are all nil, this filter finds all token transfers in the given block range.

func (*Client) UnlockAccount

func (c *Client) UnlockAccount(addr *Address, password string) error

UnlockAccount unlocks the given address with the associated passphrase.

func (*Client) UnmarshalMsg

func (z *Client) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type CompiledBundle

type CompiledBundle struct {
	Filenames []string           `msg:"filenames"` // Input filenames in sourcemap ID order
	Sources   []string           `msg:"sources"`   // actual source code, in filename order
	Contracts []CompiledContract `msg:"contracts"` // Compiled code
	Warnings  []string           `msg:"warnings"`
}

CompiledBundle represents the output of a single invocation of solc. A CompiledBundle contains zero or more contracts.

func Compile

func Compile(sources []Source) (*CompiledBundle, error)

Compile sources into a bundle with caching.

func CompileGlob

func CompileGlob(glob string) (*CompiledBundle, error)

CompileGlob compiles all the files that match the given filepath glob (e.g. "*.sol")

func CompileString

func CompileString(code string) (*CompiledBundle, error)

CompileString compiles source code from a string.

func (*CompiledBundle) Contract

func (c *CompiledBundle) Contract(name string) *CompiledContract

func (*CompiledBundle) DecodeMsg

func (z *CompiledBundle) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*CompiledBundle) EncodeMsg

func (z *CompiledBundle) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*CompiledBundle) MarshalMsg

func (z *CompiledBundle) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*CompiledBundle) Msgsize

func (z *CompiledBundle) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*CompiledBundle) SourceOf

func (b *CompiledBundle) SourceOf(c *CompiledContract, pc int) string

SourceOf returns the source line (text) of the given pc.

NOTE: right now solc creates terrible source maps. You may get the entire contract code back in the source string.

func (*CompiledBundle) UnmarshalMsg

func (z *CompiledBundle) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type CompiledContract

type CompiledContract struct {
	Name      string          `msg:"name"`      // Contract name
	Code      []byte          `msg:"code"`      // Code is the EVM bytecode for a contract
	Sourcemap string          `msg:"sourcemap"` // Sourcemap is the stringified source map for the contract
	ABI       []ABIDescriptor `msg:"abi"`       // Raw JSON ABI
	// contains filtered or unexported fields
}

CompiledContract represents a single solidity contract.

func (*CompiledContract) DecodeMsg

func (z *CompiledContract) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*CompiledContract) EncodeMsg

func (z *CompiledContract) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*CompiledContract) Find

func (c *CompiledContract) Find(desc string) *ABIDescriptor

Find finds a function or event based on the hash of the descriptor. Keep in mind that the descriptor must use canonical type names and no superfluous whitespace.

For example:

c.Find("transfer(address,uint256)")

find the ERC20 "transfer" function. Similarly,

c.Find("Transfer(address,address,uint256)")

finds the ERC20 "Transfer" event.

func (*CompiledContract) MarshalMsg

func (z *CompiledContract) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*CompiledContract) Msgsize

func (z *CompiledContract) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*CompiledContract) UnmarshalMsg

func (z *CompiledContract) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Data

type Data []byte

Data is just binary that can decode Ethereum's silly quoted hex

func (*Data) DecodeMsg

func (z *Data) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*Data) EncodeABI

func (d *Data) EncodeABI(v []byte) []byte

func (Data) EncodeMsg

func (z Data) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (Data) MarshalMsg

func (z Data) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (Data) MarshalText

func (d Data) MarshalText() ([]byte, error)

func (Data) Msgsize

func (z Data) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Data) String

func (d *Data) String() string

func (*Data) UnmarshalMsg

func (z *Data) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*Data) UnmarshalText

func (d *Data) UnmarshalText(b []byte) error

type DataSlice

type DataSlice []Data

func (*DataSlice) EncodeABI

func (d *DataSlice) EncodeABI(v []byte) []byte

func (*DataSlice) Len

func (d *DataSlice) Len() int

type EtherSlice

type EtherSlice interface {
	// The implementation of EtherSlice.EncodeABI should
	// only concatenate the raw slice values to the input,
	// and not the slice length prefix.
	EtherType

	// Len should return the number of elements in the slice
	Len() int
}

EtherSlice is an EtherType that represents a dynamically-sized list (e.g. []address or []uint in solidity)

type EtherType

type EtherType interface {
	// EncodeABI encodes this type using the
	// canonical contract ABI encoding
	EncodeABI(v []byte) []byte
	// contains filtered or unexported methods
}

EtherType represents a type in the Ethereum Contract ABI type system https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI

type Filter

type Filter struct {
	// contains filtered or unexported fields
}

Filter represents a Log filter

func (*Filter) Close

func (f *Filter) Close()

Close will close the filter. Closing the filter will cause the output channel to be closed. Close is safe to call from any goroutine.

func (*Filter) Err

func (f *Filter) Err() error

Err returns an error if the filter has encountered an error while fetching logs.

func (*Filter) Out

func (f *Filter) Out() <-chan *Log

Out returns the channel of output logs. The output channel will be closed when the filter is closed, or when the filter encounters an error, in which case (*Filter).Err() will be non-nil.

type HSM

type HSM interface {
	// Unlock unlocks the hardware security module.
	// It is acceptable for this function to be a no-op
	// if no software unlocking feature exists.
	Unlock(b []byte) error

	// Pubkeys returns the list of secp256k1 public keys
	// on the device, along with the ID of the key.
	Pubkeys() ([]HSMKey, error)

	// Signer should return a Signer function that
	// can be passed to functions like seth.SignTransaction
	Signer(key *HSMKey) (Signer, error)
}

HSM is the interface that an HSM (Hardware Security Module) driver has to impelement. This interface is deliberately Ethereum-specific.

func FindHSM

func FindHSM(name string, probe ...string) HSM

FindHSM finds an HSM based on an HSM name and probe hints. If no HSM is found, nil is returned.

type HSMKey

type HSMKey struct {
	ID     string      // ID is an opaque, device-specific identifier
	Public PublicKey   // Public is the public part of the secp256k1 key-pair
	Aux    interface{} // Device-specific data
}

HSMKey represents a key on an HSM device.

type HTTPTransport

type HTTPTransport struct {
	URL string
}

An HTTPTransport is a client transport for making requests over HTTP.

func (*HTTPTransport) Execute

func (t *HTTPTransport) Execute(req *RPCRequest, res *RPCResponse) error

Execute implements Transport.

type Hash

type Hash [32]byte

Hash represents a Keccak256 hash

func HashBytes

func HashBytes(b []byte) Hash

HashBytes produces the Keccak-256 hash of the given bytes

func HashString

func HashString(s string) Hash

HashString produces a Hash that corresponds to the Keccak-256 hash of the given string

func ParseHash

func ParseHash(s string) (*Hash, error)

ParseHash parses a hash.

func (*Hash) DecodeMsg

func (z *Hash) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*Hash) EncodeMsg

func (z *Hash) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*Hash) FromString

func (h *Hash) FromString(s string) error

func (*Hash) MarshalMsg

func (z *Hash) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (Hash) MarshalText

func (h Hash) MarshalText() ([]byte, error)

func (*Hash) Msgsize

func (z *Hash) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Hash) Scan

func (h *Hash) Scan(s fmt.ScanState, verb rune) error

Scan implements fmt.Scanner (uses %h verb)

func (*Hash) String

func (h *Hash) String() string

String produces the hash as a 0x-prefixed hex string

func (*Hash) UnmarshalMsg

func (z *Hash) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*Hash) UnmarshalText

func (h *Hash) UnmarshalText(b []byte) error

type InfuraTransport

type InfuraTransport struct{}

InfuraTransport is a transport that operates on https://api.infura.io/v1/jsonrpc/mainnet

func (InfuraTransport) Execute

func (i InfuraTransport) Execute(req *RPCRequest, res *RPCResponse) error

type Int

type Int big.Int

Int is a big.Int that can decode Ethereum's silly quoted hex

func NewInt

func NewInt(x int64) *Int

NewInt allocates and returns a new Int set to x.

func ParseInt

func ParseInt(s string) (*Int, error)

func (*Int) Big

func (i *Int) Big() *big.Int

Big is a convenience method for (*big.Int)(i).

func (*Int) Cmp

func (i *Int) Cmp(x *Int) int

Cmp compares this Int to x. See big.Int.Cmp.

func (*Int) Copy

func (i *Int) Copy() Int

func (*Int) DecodeMsg

func (i *Int) DecodeMsg(r *msgp.Reader) error

func (*Int) EncodeABI

func (i *Int) EncodeABI(v []byte) []byte

EncodeABI implements EtherType

func (*Int) EncodeMsg

func (i *Int) EncodeMsg(w *msgp.Writer) error

func (*Int) FromString

func (i *Int) FromString(s string) error

func (*Int) Int64

func (i *Int) Int64() int64

func (*Int) IsZero

func (i *Int) IsZero() bool

func (*Int) MarshalMsg

func (i *Int) MarshalMsg(b []byte) ([]byte, error)

func (Int) MarshalText

func (i Int) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*Int) Msgsize

func (i *Int) Msgsize() int

func (*Int) Scan

func (i *Int) Scan(s fmt.ScanState, verb rune) error

Scan implements fmt.Scanner

func (*Int) SetInt64

func (i *Int) SetInt64(v int64)

func (*Int) SetUint64

func (i *Int) SetUint64(v uint64)

func (*Int) String

func (i *Int) String() string

func (*Int) Uint64

func (i *Int) Uint64() uint64

func (*Int) UnmarshalJSON

func (i *Int) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*Int) UnmarshalMsg

func (i *Int) UnmarshalMsg(b []byte) ([]byte, error)

func (*Int) UnmarshalText

func (i *Int) UnmarshalText(b []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

type IntSlice

type IntSlice []Int

IntSlice is an implementation of EtherSlice for a list of integers

func (*IntSlice) EncodeABI

func (i *IntSlice) EncodeABI(v []byte) []byte

EncodeABI implements EtherType.EncodeABI

func (*IntSlice) Len

func (i *IntSlice) Len() int

Len implements EtherSlice.Len

type Keyfile

type Keyfile struct {
	ID      string `json:"id"`
	Version int    `json:"version"`
	Crypto  struct {
		Cipher       string          `json:"cipher"`
		CipherParams json.RawMessage `json:"cipherparams"`
		Ciphertext   string          `json:"ciphertext"`
		KDF          string          `json:"kdf"`
		KDFParams    json.RawMessage `json:"kdfparams"`
		MAC          string          `json:"mac"`
	} `json:"crypto"`
	Address string          `json:"address,omitempty"`
	Name    string          `json:"name"`
	Meta    json.RawMessage `json:"meta"`
}

Keyfile represents an Ethereum key file as defined in the "Web3 Secret Storage Definition"

func (*Keyfile) Private

func (k *Keyfile) Private(passphrase []byte) (*PrivateKey, error)

Private uses a passphrase to unlock a keyfile and produce its private key.

type Log

type Log struct {
	Removed     bool    `json:"removed"`
	LogIndex    *Uint64 `json:"logIndex"` // nil if pending; same for following fields
	TxIndex     *Uint64 `json:"transactionIndex"`
	TxHash      *Hash   `json:"transactionHash"`
	BlockHash   *Hash   `json:"blockHash"`
	BlockNumber *Uint64 `json:"blockNumber"`
	Address     Address `json:"address"`
	Data        Data    `json:"data"`   // serialized log arguments
	Topics      []Data  `json:"topics"` // indexed log arguments
}

Log is an Ethereum log (or, in Solidity, an "event")

func (*Log) DecodeMsg

func (z *Log) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*Log) EncodeMsg

func (z *Log) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*Log) MarshalMsg

func (z *Log) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Log) Msgsize

func (z *Log) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Log) UnmarshalMsg

func (z *Log) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type PrivateKey

type PrivateKey [32]byte

A PrivateKey holds a private key.

func GenPrivateKey

func GenPrivateKey() *PrivateKey

GenPrivateKey generates a private key from the default entropy source.

func NewPrivateKey

func NewPrivateKey(d *big.Int) *PrivateKey

NewPrivateKey creates a private key from d.

func ParsePrivateKey

func ParsePrivateKey(s string) (*PrivateKey, error)

ParsePrivateKey parses a private key.

func (*PrivateKey) Address

func (k *PrivateKey) Address() *Address

Address returns the address corresponding to this private key.

func (*PrivateKey) FromString

func (k *PrivateKey) FromString(s string) error

FromString parses a private key from a string.

func (*PrivateKey) MarshalText

func (k *PrivateKey) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*PrivateKey) PublicKey

func (k *PrivateKey) PublicKey() *PublicKey

PublicKey returns the public key corresponding to this private key.

func (*PrivateKey) Sign

func (k *PrivateKey) Sign(hash *Hash) *Signature

Sign a hash with this private key.

func (*PrivateKey) Signer

func (k *PrivateKey) Signer() Signer

Signer returns a Signer for this private key.

func (*PrivateKey) String

func (k *PrivateKey) String() string

String returns a string representation of the private key.

func (*PrivateKey) ToECDSA

func (k *PrivateKey) ToECDSA() *ecdsa.PrivateKey

ToECDSA returns the private key as an ECDSA private key.

func (*PrivateKey) ToKeyfile

func (p *PrivateKey) ToKeyfile(name string, pass []byte) *Keyfile

ToKeyfile produces a Keyfile for p with the given name and password. The Keyfile is produced using the strongest available parameters, which, as of this writing, are aes-128-ctr encryption and scrypt-based key-derivation. Pass Name may be "". For privacy reasons, ToKeyfile doesn't set Keyfile.Address.

func (*PrivateKey) UnmarshalText

func (k *PrivateKey) UnmarshalText(b []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

type PublicKey

type PublicKey [64]byte

A PublicKey holds a public key.

func NewPublicKey

func NewPublicKey(x, y *big.Int) *PublicKey

NewPublicKey creates a public key from X and Y.

func ParsePublicKey

func ParsePublicKey(s string) (*PublicKey, error)

ParsePublicKey parses a public key.

func (*PublicKey) Address

func (k *PublicKey) Address() *Address

Address returns the address corresponding to this public key.

func (*PublicKey) FromString

func (k *PublicKey) FromString(s string) error

FromString parses a public key from a string.

func (*PublicKey) MarshalText

func (k *PublicKey) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*PublicKey) String

func (k *PublicKey) String() string

String returns a string representation of the public key.

func (*PublicKey) ToECDSA

func (k *PublicKey) ToECDSA() *ecdsa.PublicKey

ToECDSA returns the public key as an ECDSA public key.

func (*PublicKey) UnmarshalText

func (k *PublicKey) UnmarshalText(b []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

type RPCError

type RPCError struct {
	Code    int             `json:"code"`
	Message string          `json:"message"`
	Data    json.RawMessage `json:"data"`
}

RPCError is an error returned by a server

func (*RPCError) DecodeMsg

func (z *RPCError) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (RPCError) EncodeMsg

func (z RPCError) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*RPCError) Error

func (e *RPCError) Error() string

func (RPCError) MarshalMsg

func (z RPCError) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (RPCError) Msgsize

func (z RPCError) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*RPCError) UnmarshalMsg

func (z *RPCError) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type RPCRequest

type RPCRequest struct {
	Version string            `json:"jsonrpc"`
	Method  string            `json:"method"`
	Params  []json.RawMessage `json:"params"`
	ID      int               `json:"id"`
}

RPCRequest is a request to be sent to an RPC server.

type RPCResponse

type RPCResponse struct {
	ID      int             `json:"id"`
	Version string          `json:"jsonrpc"`
	Result  json.RawMessage `json:"result"`
	Error   RPCError        `json:"error"`
}

RPCResponse is a response returned by an RPC server.

type RPCTransport

type RPCTransport struct {
	// contains filtered or unexported fields
}

An RPCTrasport is a client transport for making requests over an RPC connection.

func (*RPCTransport) Execute

func (t *RPCTransport) Execute(req *RPCRequest, res *RPCResponse) error

type Receipt

type Receipt struct {
	Hash        Hash     `json:"transactionHash"`
	Index       Uint64   `json:"transactionIndex"`
	BlockHash   Hash     `json:"blockHash"`
	BlockNumber Uint64   `json:"blockNumber"`
	GasUsed     Uint64   `json:"gasUsed"`
	Cumulative  Uint64   `json:"cumulativeGasUsed"`
	Address     *Address `json:"contractAddress"` // contract created, or none if not a contract creation
	Status      Uint64   `json:"status"`
	Logs        []Log    `json:"logs"`
}

Receipt is a transaction receipt

func (*Receipt) DecodeMsg

func (z *Receipt) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*Receipt) EncodeMsg

func (z *Receipt) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*Receipt) MarshalMsg

func (z *Receipt) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Receipt) Msgsize

func (z *Receipt) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Receipt) ParseTransfer

func (r *Receipt) ParseTransfer(l *Log) (TokenTransfer, bool)

ParseTransfer tries to parse this log as an ERC20 token transfer event, with the signature

event Transfer(address indexed from, address indexed to, uint256 value);

func (*Receipt) Threw

func (r *Receipt) Threw() bool

Threw returns whether the transaction threw.

func (*Receipt) UnmarshalMsg

func (z *Receipt) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Sender

type Sender struct {
	*Client
	Addr *Address

	// A Signer can be used to sign raw transactions for this sender. If
	// this is set, all transactions will be sent as raw transactions.
	Signer Signer

	// GasRatio is the ratio of the gas estimate
	// to use as the gas offered for a transaction,
	// expressed as a rational number.
	// For instance, Num=5,Denom=4 would offer 5/4ths of
	// the gas estimate as the gas for a transaction.
	GasRatio struct {
		Num, Denom int
	}

	// GasPrice is the gas price offered for each transaction.
	GasPrice Int
}

Sender is a client that sends transactions from a particular address.

func NewSender

func NewSender(c *Client, from *Address) *Sender

NewSender constructs a Sender with sane defaults.

func (*Sender) Call

func (s *Sender) Call(opts *CallOpts) (Hash, error)

Call makes a transaction call using the given CallOpts. Omitted fields are populated with default values.

func (*Sender) Cancel

func (s *Sender) Cancel(h *Hash) (Hash, error)

Cancel a transaction with the given hash.

func (*Sender) ConstCall

func (s *Sender) ConstCall(to *Address, method string, out interface{}, args ...EtherType) error

func (*Sender) Create

func (s *Sender) Create(code []byte, value *Int) (Address, error)

Create creates a new contract with the given contract code. This call blocks until the transaction posts, and then returns the contract's address.

func (*Sender) Drain

func (s *Sender) Drain(prompt ...func(t *Transaction)) error

Drain waits for the pending transaction pool to contain no transactions from this account.

func (*Sender) Send

func (s *Sender) Send(to *Address, method string, args ...EtherType) (Hash, error)

Send makes a contract call from the sender address. It automatically handles gas estimation and padding.

func (*Sender) Wait

func (s *Sender) Wait(h *Hash) error

Wait waits for a transaction hash to be mined into the canonical chain.

type Signature

type Signature [65]byte

A Signature holds an ECDSA signature in Ethereum's compact representation.

func NewSignature

func NewSignature(r, s *big.Int, v int) *Signature

NewSignature constructs a signature from r, s, and v.

func ParseSignature

func ParseSignature(s string) (*Signature, error)

ParseSignature parses a signature from a string.

func (*Signature) FromString

func (s *Signature) FromString(z string) error

FromString parses a signature from a string.

func (*Signature) MarshalText

func (s *Signature) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*Signature) Parts

func (z *Signature) Parts() (r, s big.Int, v int)

Parts returns the r, s, and v parts of the signature.

func (*Signature) Recover

func (z *Signature) Recover(hash *Hash) (*PublicKey, error)

Recover validates the signature and returns a public key given the hash.

func (*Signature) String

func (s *Signature) String() string

String returns a string representation of the signature.

func (*Signature) UnmarshalText

func (s *Signature) UnmarshalText(b []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (*Signature) Valid

func (z *Signature) Valid() bool

Valid checks whether the signature is valid.

type Signer

type Signer func(*Hash) (*Signature, error)

A Signer is a function capable of signing a hash.

type Source

type Source struct {
	Filename string
	Body     string
}

func (*Source) DecodeMsg

func (z *Source) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (Source) EncodeMsg

func (z Source) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (Source) MarshalMsg

func (z Source) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (Source) Msgsize

func (z Source) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Source) UnmarshalMsg

func (z *Source) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type SyncStatus

type SyncStatus struct {
	Starting Uint64 `json:"startingBlock"` // Starting block of sync.
	Current  Uint64 `json:"currentBlock"`  // Current block of sync.
	Highest  Uint64 `json:"highestBlock"`  // Highest block of sync, estimated.
}

SyncStatus indicates the syncing status of the node.

type TokenTransfer

type TokenTransfer struct {
	Block    int64   // block number
	TxHeight int     // index of transaction in block
	Token    Address // address of contract
	From     Address // 'from' argument in transfer
	To       Address // 'to' argument in transfer
	Amount   Int     // value amount
}

TokenTransfer represents an ERC20 token transfer event

func (*TokenTransfer) DecodeMsg

func (z *TokenTransfer) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*TokenTransfer) EncodeMsg

func (z *TokenTransfer) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*TokenTransfer) MarshalMsg

func (z *TokenTransfer) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*TokenTransfer) Msgsize

func (z *TokenTransfer) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*TokenTransfer) UnmarshalMsg

func (z *TokenTransfer) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Transaction

type Transaction struct {
	Hash        Hash     `json:"hash"`             // tx hash
	Nonce       Uint64   `json:"nonce"`            // sender nonce
	Block       Hash     `json:"blockHash"`        // hash of parent block
	BlockNumber Uint64   `json:"blockNumber"`      //
	To          *Address `json:"to"`               // receiver, or nil for contract creation
	TxIndex     *Uint64  `json:"transactionIndex"` // transaction index, or nil if pending
	From        *Address `json:"from"`             // from
	Value       Int      `json:"value"`            // value in wei
	GasPrice    Int      `json:"gasPrice"`         // gas price
	Gas         Uint64   `json:"gas"`              // gas spent on transaction
	Input       Data     `json:"input"`            // input data
}

Transaction represents an ethereum transaction.

func (*Transaction) DecodeMsg

func (z *Transaction) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*Transaction) Encode

func (t *Transaction) Encode(sig *Signature) []byte

Encode returns an RLP encoded representation of the transaction. If a signature is provided, this will return an encoded representation containing the signature.

func (*Transaction) EncodeMsg

func (z *Transaction) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*Transaction) HashToSign

func (t *Transaction) HashToSign() *Hash

HashToSign returns a hash which can be used to sign the transaction.

func (*Transaction) MarshalMsg

func (z *Transaction) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Transaction) Msgsize

func (z *Transaction) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Transaction) UnmarshalMsg

func (z *Transaction) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Transport

type Transport interface {
	Execute(req *RPCRequest, res *RPCResponse) error
}

type Uint64

type Uint64 uint64

Uint64 is a uint64 that marshals as a hex-encoded number.

func (*Uint64) DecodeMsg

func (z *Uint64) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (Uint64) EncodeMsg

func (z Uint64) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (Uint64) MarshalMsg

func (z Uint64) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (Uint64) MarshalText

func (i Uint64) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (Uint64) Msgsize

func (z Uint64) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Uint64) UnmarshalJSON

func (i *Uint64) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*Uint64) UnmarshalMsg

func (z *Uint64) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*Uint64) UnmarshalText

func (i *Uint64) UnmarshalText(b []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

Directories

Path Synopsis
package cc is a library for converting between cryptocurrencies.
package cc is a library for converting between cryptocurrencies.
cmd
eth
Package yubihsm implements a cgo wrapper around yubihsm.h provided by the YubiHSM2 SDK.
Package yubihsm implements a cgo wrapper around yubihsm.h provided by the YubiHSM2 SDK.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL