Documentation ¶
Index ¶
- Variables
- func GeneratePrefixedHash(data []byte) []byte
- func GetAddrPrivKeyFromKeystore(keyjson, passphrase string) (common.Address, string, error)
- func IsSignatureValid(signer common.Address, data []byte, sig []byte) bool
- func RecoverSigner(data []byte, sig []byte) (common.Address, error)
- func WaitMined(ctx context.Context, ec *ethclient.Client, tx *types.Transaction, ...) (*types.Receipt, error)
- func WaitMinedWithTxHash(ctx context.Context, ec *ethclient.Client, txHash string, opts ...TxOption) (*types.Receipt, error)
- type CelerSigner
- type KmsSigner
- func (s *KmsSigner) NewTransactOpts() *bind.TransactOpts
- func (s *KmsSigner) Sign(hash []byte) ([]byte, error)
- func (s *KmsSigner) SignEthMessage(data []byte) ([]byte, error)
- func (s *KmsSigner) SignEthTransaction(rawTx []byte) ([]byte, error)
- func (s *KmsSigner) SignerFn(addr common.Address, tx *types.Transaction) (*types.Transaction, error)
- type PubKeyAsn
- type RS
- type Signer
- type TransactionStateHandler
- type Transactor
- func (t *Transactor) Address() common.Address
- func (t *Transactor) ContractCaller() bind.ContractCaller
- func (t *Transactor) Transact(handler *TransactionStateHandler, method TxMethod, opts ...TxOption) (*types.Transaction, error)
- func (t *Transactor) TransactWaitMined(description string, method TxMethod, opts ...TxOption) (*types.Receipt, error)
- func (t *Transactor) WaitMined(txHash string, opts ...TxOption) (*types.Receipt, error)
- type TransactorConfig
- type TransactorPool
- func (p *TransactorPool) ContractCaller() bind.ContractCaller
- func (p *TransactorPool) Submit(handler *TransactionStateHandler, method TxMethod, opts ...TxOption) (*types.Transaction, error)
- func (p *TransactorPool) SubmitWaitMined(description string, method TxMethod, opts ...TxOption) (*types.Receipt, error)
- func (p *TransactorPool) WaitMined(txHash string, opts ...TxOption) (*types.Receipt, error)
- type TxMethod
- type TxOption
- func WithAddGasEstimateRatio(r float64) TxOption
- func WithAddGasGwei(g uint64) TxOption
- func WithBlockDelay(d uint64) TxOption
- func WithDropDetection(d bool) TxOption
- func WithEthValue(v *big.Int) TxOption
- func WithForceGasGwei(g string) TxOption
- func WithGasLimit(l uint64) TxOption
- func WithMaxFeePerGasGwei(g uint64) TxOption
- func WithMaxGasGwei(g uint64) TxOption
- func WithMaxPendingTxNum(n uint64) TxOption
- func WithMaxPriorityFeePerGasGwei(g float64) TxOption
- func WithMaxSubmittingTxNum(n uint64) TxOption
- func WithMinGasGwei(g uint64) TxOption
- func WithPollingInterval(t time.Duration) TxOption
- func WithQueryRetryInterval(t time.Duration) TxOption
- func WithQueryTimeout(t time.Duration) TxOption
- func WithTimeout(t time.Duration) TxOption
Constants ¶
This section is empty.
Variables ¶
var ( ErrConflictingGasFlags = errors.New("cannot specify both legacy and EIP-1559 gas flags") ErrTooManyPendingTx = errors.New("too many txs in pending status") ErrTooManySubmittingTx = errors.New("too many txs in submitting status") )
var ( ErrTxDropped = errors.New("onchain transaction dropped") ErrTxTimeout = errors.New("onchain transaction timeout") ErrTxReorg = errors.New("onchain transaction reorg") // an error possibly returned when a transaction is pending ErrMissingField = errors.New("missing required field 'transactionHash' for Log") )
Functions ¶
func GeneratePrefixedHash ¶
func IsSignatureValid ¶ added in v0.1.13
Types ¶
type CelerSigner ¶
type CelerSigner struct {
// contains filtered or unexported fields
}
func NewSigner ¶
func NewSigner(privateKey string, chainId *big.Int) (*CelerSigner, error)
Create a new Signer object from the private key chainId could be nil if the signer is expected to only call SignEthMessage func
func NewSignerFromKeystore ¶
func NewSignerFromKeystore(keyjson, passphrase string, chainId *big.Int) (*CelerSigner, error)
Create a new Signer object from the keystore json and passphrase chainId could be nil if the signer is expected to only call SignEthMessage func
func (*CelerSigner) SignEthMessage ¶
func (s *CelerSigner) SignEthMessage(data []byte) ([]byte, error)
input data: a byte array of raw message to be signed return a byte array signature in the R,S,V format
func (*CelerSigner) SignEthTransaction ¶
func (s *CelerSigner) SignEthTransaction(rawTx []byte) ([]byte, error)
input rawTx: a byte array of a RLP-encoded unsigned Ethereum raw transaction return a byte array signed raw tx in RLP-encoded format
type KmsSigner ¶ added in v0.1.38
impl Signer interface
func NewKmsSigner ¶ added in v0.1.38
region and keyAlias must be valid, eg. us-west-1 alias/mytestkey if awsKey, awsSec are empty string, will use aws sdk auto search
func (*KmsSigner) NewTransactOpts ¶ added in v0.1.41
func (s *KmsSigner) NewTransactOpts() *bind.TransactOpts
return bind.TransactOpts to be used in bound contract tx
func (*KmsSigner) Sign ¶ added in v0.1.38
input must be hash, return 65 bytes sig or error. sig[64] is 0 or 1
func (*KmsSigner) SignEthMessage ¶ added in v0.1.38
satisfy Signer interface SignEthMessage
func (*KmsSigner) SignEthTransaction ¶ added in v0.1.38
satisfy Signer interface SignEthTransaction
func (*KmsSigner) SignerFn ¶ added in v0.1.41
func (s *KmsSigner) SignerFn(addr common.Address, tx *types.Transaction) (*types.Transaction, error)
satisfy bind/base.go SignerFn
type PubKeyAsn ¶ added in v0.1.38
type PubKeyAsn struct { Algo pkix.AlgorithmIdentifier PubKey asn1.BitString }
type Signer ¶
type Signer interface { // input data: a byte array of raw message to be signed // return a byte array signature in the R,S,V format // The implementation should hash data w/ keccak256, and add // "\x19Ethereum Signed Message:\n32" prefix (32 is the length of hash result) // for ECDSA sign. If some library handles prefix automatically, pass hash // result is sufficient SignEthMessage(data []byte) ([]byte, error) // input rawTx: a byte array of a RLP-encoded unsigned Ethereum raw transaction // return a byte array signed raw tx in RLP-encoded format SignEthTransaction(rawTx []byte) ([]byte, error) }
type TransactionStateHandler ¶
type TransactionStateHandler struct { OnMined func(receipt *types.Receipt) OnError func(tx *types.Transaction, err error) }
type Transactor ¶
type Transactor struct {
// contains filtered or unexported fields
}
func NewTransactor ¶
func (*Transactor) Address ¶
func (t *Transactor) Address() common.Address
func (*Transactor) ContractCaller ¶
func (t *Transactor) ContractCaller() bind.ContractCaller
func (*Transactor) Transact ¶
func (t *Transactor) Transact( handler *TransactionStateHandler, method TxMethod, opts ...TxOption) (*types.Transaction, error)
func (*Transactor) TransactWaitMined ¶
type TransactorConfig ¶
func NewTransactorConfig ¶
func NewTransactorConfig(keyjson string, passphrase string) *TransactorConfig
type TransactorPool ¶
type TransactorPool struct {
// contains filtered or unexported fields
}
func NewTransactorPool ¶
func NewTransactorPool(transactors []*Transactor) (*TransactorPool, error)
func NewTransactorPoolFromConfig ¶
func NewTransactorPoolFromConfig( client *ethclient.Client, configs []*TransactorConfig, chainId *big.Int, opts ...TxOption) (*TransactorPool, error)
func (*TransactorPool) ContractCaller ¶
func (p *TransactorPool) ContractCaller() bind.ContractCaller
func (*TransactorPool) Submit ¶
func (p *TransactorPool) Submit( handler *TransactionStateHandler, method TxMethod, opts ...TxOption) (*types.Transaction, error)
func (*TransactorPool) SubmitWaitMined ¶
type TxMethod ¶
type TxMethod func(transactor bind.ContractTransactor, opts *bind.TransactOpts) (*types.Transaction, error)
type TxOption ¶ added in v0.1.13
type TxOption interface {
// contains filtered or unexported methods
}