ethtx

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

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

Go to latest
Published: Jul 7, 2019 License: MIT Imports: 12 Imported by: 0

README

eth-tx

以太坊交易构建签名工具

Documentation

Index

Constants

View Source
const TokenABI = "" /* 4091-byte string literal not displayed */

Variables

This section is empty.

Functions

func DecodeAddress

func DecodeAddress(hex_address string) (common.Address, error)

func DecodePrivKey

func DecodePrivKey(privkey string) (*ecdsa.PrivateKey, error)

func DecodeTx

func DecodeTx(unsign_tx string) (*types.Transaction, error)

func DeriveTxFrom

func DeriveTxFrom(tx *types.Transaction) (string, error)

func GenTrasferABI

func GenTrasferABI(to string, amount *big.Int) string

func SignTx

func SignTx(unsign_tx string, privkey string, chainid uint64) (string, error)

Types

type Builder

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

func NewBuilder

func NewBuilder() *Builder

func (*Builder) Build

func (b *Builder) Build() ([]byte, error)

func (*Builder) SetAmount

func (b *Builder) SetAmount(amount *big.Int)

func (*Builder) SetBalance

func (b *Builder) SetBalance(balance *big.Int)

func (*Builder) SetFrom

func (b *Builder) SetFrom(from string)

func (*Builder) SetNonce

func (b *Builder) SetNonce(nonce uint64)

func (*Builder) SetPrice

func (b *Builder) SetPrice(price *big.Int)

func (*Builder) SetTo

func (b *Builder) SetTo(to string)

type Coin

type Coin struct {
	Nonce   uint64
	Balance *big.Int
}

type TokenBuilder

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

func NewTokenBuilder

func NewTokenBuilder() *TokenBuilder

func (*TokenBuilder) Build

func (b *TokenBuilder) Build() ([]byte, error)

func (*TokenBuilder) SetAmount

func (b *TokenBuilder) SetAmount(amount *big.Int)

func (*TokenBuilder) SetContract

func (b *TokenBuilder) SetContract(contract string)

func (*TokenBuilder) SetFrom

func (b *TokenBuilder) SetFrom(from string)

func (*TokenBuilder) SetLimit

func (b *TokenBuilder) SetLimit(limit uint64)

func (*TokenBuilder) SetNonce

func (b *TokenBuilder) SetNonce(nonce uint64)

func (*TokenBuilder) SetPrice

func (b *TokenBuilder) SetPrice(price *big.Int)

func (*TokenBuilder) SetTo

func (b *TokenBuilder) SetTo(to string)

Jump to

Keyboard shortcuts

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