Documentation
¶
Index ¶
- func NewAccountFromMnemonic(mnemonic, path string) (signing.AccountHandler, error)
- func NewAccountFromPrivateKey(privateKey []byte) (signing.AccountHandler, error)
- func NewAccountFromPrivateKeyHex(privateKey string) (signing.AccountHandler, error)
- func PublicKey2Address(publicKey []byte) (string, error)
- func ValidAddress(address string) bool
- type Account
- func (a *Account) Address() string
- func (a *Account) PrivateKey() []byte
- func (a *Account) PrivateKeyHex() string
- func (a *Account) PublicKey() []byte
- func (a *Account) PublicKeyHex() string
- func (a *Account) SignData(data []byte) ([]byte, error)
- func (a *Account) VerifySignData(data, sig []byte) bool
- func (a *Account) Wipe()
- type Ingredient
- type TxBuilder
- func (tx *TxBuilder) Build() error
- func (tx *TxBuilder) ConcatSignature(signature string, isDerFormat bool) (string, error)
- func (tx *TxBuilder) GetSigHash() []string
- func (tx *TxBuilder) GetTxHash() string
- func (tx *TxBuilder) GetUnsignedHex() string
- func (tx *TxBuilder) SetSigHash(s []string)
- func (tx *TxBuilder) SetUnsignedHex(s string)
- func (tx *TxBuilder) Sign(privateKey []byte) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAccountFromMnemonic ¶
func NewAccountFromMnemonic(mnemonic, path string) (signing.AccountHandler, error)
func NewAccountFromPrivateKey ¶
func NewAccountFromPrivateKey(privateKey []byte) (signing.AccountHandler, error)
func NewAccountFromPrivateKeyHex ¶
func NewAccountFromPrivateKeyHex(privateKey string) (signing.AccountHandler, error)
func PublicKey2Address ¶
func ValidAddress ¶
Types ¶
type Account ¶
type Account struct {
// contains filtered or unexported fields
}
func (*Account) PrivateKey ¶
func (*Account) PrivateKeyHex ¶
func (*Account) PublicKeyHex ¶
func (*Account) VerifySignData ¶
type Ingredient ¶
type Ingredient struct {
TxType string `json:"txType"`
ContractAddress string `json:"contractAddress"`
Sender string `json:"sender,omitempty"`
SenderPublicKey string `json:"senderPublicKey,omitempty"`
Recipient string `json:"recipient"`
Amount string `json:"amount"`
Nonce string `json:"nonce"`
L1GasMaxAmount string `json:"l1GasMaxAmount"`
L1GasMaxPrice string `json:"l1GasMaxPrice"`
L1DataGasMaxAmount string `json:"l1DataGasMaxAmount"`
L1DataGasMaxPrice string `json:"l1DataGasMaxPrice"`
L2GasMaxAmount string `json:"l2GasMaxAmount"`
L2GasMaxPrice string `json:"l2GasMaxPrice"`
Tip string `json:"tip"`
}
type TxBuilder ¶
type TxBuilder struct {
*Ingredient
// contains filtered or unexported fields
}
func NewTxBuilder ¶
func NewTxBuilder(ti *Ingredient) *TxBuilder
func (*TxBuilder) ConcatSignature ¶
func (*TxBuilder) GetSigHash ¶
func (*TxBuilder) GetUnsignedHex ¶
func (*TxBuilder) SetSigHash ¶
func (*TxBuilder) SetUnsignedHex ¶
Click to show internal directories.
Click to hide internal directories.