Documentation
¶
Index ¶
- Constants
- Variables
- func AddressToBytes(addr string) []byte
- func CalTxHash(tx string) (string, error)
- func GetAddressByPrivateKey(privateKeyHex string, chainId string) (string, error)
- func GetAddressByPublicKey(publicKeyHex string, chainId string) (string, error)
- func GetPublicKey(privateKeyHex string) (string, error)
- func NewPrivateKey() string
- func SignedTx(message *Message, signHex string) (string, error)
- type BigInt
- type Message
- type Signature
- type SignedMessage
Constants ¶
View Source
const ( MainnetPrefix = "f" TestnetPrefix = "t" // MaxInt64StringLength defines the maximum length of `int64` as a string. MaxInt64StringLength = 19 // ChecksumHashLength defines the hash length used for calculating address checksums. ChecksumHashLength = 4 // MaxSubaddressLen is the maximum length of a delegated address's sub-address. MaxSubaddressLen = 54 )
View Source
const ( ID byte = iota SECP256K1 Actor BLS Delegated )
Variables ¶
View Source
var (
AddressEncoding = base32.NewEncoding(encodeStd)
)
Functions ¶
func AddressToBytes ¶
func GetAddressByPrivateKey ¶
func GetAddressByPublicKey ¶
func GetPublicKey ¶
func NewPrivateKey ¶
func NewPrivateKey() string
Types ¶
type Message ¶
type Message struct {
Version uint64 `json:"Version"`
To string `json:"To"`
From string `json:"From"`
Nonce uint64 `json:"Nonce"`
Value *BigInt `json:"Value"`
GasLimit int64 `json:"GasLimit"`
GasFeeCap *BigInt `json:"GasFeeCap"`
GasPremium *BigInt `json:"GasPremium"`
Method uint64 `json:"Method"`
Params []byte `json:"Params" cbor:"omitempty"`
}
type SignedMessage ¶
type SignedMessage struct {
Message *Message `json:"Message"`
Signature Signature `json:"Signature"`
}
func (*SignedMessage) Hash ¶
func (sm *SignedMessage) Hash() string
func (*SignedMessage) Serialize ¶
func (sm *SignedMessage) Serialize() []byte
Click to show internal directories.
Click to hide internal directories.