Documentation ¶
Index ¶
- Variables
- func DecodeMessage(msg *Message) (*types.Message, error)
- func DecodeParams(params ParamsInfo) ([]byte, error)
- func DecodeSignature(signature string) (crypto.Signature, error)
- func DecodeSignedMessage(signedMsg *SignedMessage) (*types.SignedMessage, error)
- func EncodeSignature(signature crypto.Signature) (string, error)
- type Message
- type ParamsInfo
- type SignedMessage
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotSupported = errors.New("not supported")
Functions ¶
func DecodeParams ¶
func DecodeParams(params ParamsInfo) ([]byte, error)
func DecodeSignedMessage ¶
func DecodeSignedMessage(signedMsg *SignedMessage) (*types.SignedMessage, error)
Types ¶
type Message ¶
type Message struct { Version uint64 `json:"version"` To string `json:"to"` From string `json:"from"` Nonce uint64 `json:"nonce"` Value int64 `json:"value"` GasLimit int64 `json:"gas_limit"` GasFeeCap int64 `json:"gas_feecap"` GasPremium int64 `json:"gas_premium"` Method uint64 `json:"method"` Params ParamsInfo `json:"params"` }
type ParamsInfo ¶
func EncodeParams ¶
func EncodeParams(params interface{}) (*ParamsInfo, error)
type SignedMessage ¶
SignedMessage : Signature use CBOR encoding and conforms to lotus spec
sign := crypto.Signature{ Type: crypto.SigTypeSecp256k1, Data: []byte{1, 2, 3, 4}, } var buf bytes.Buffer sign.MarshalCBOR(&buf) signedMsg := SignedMessage{ Signature: buf.String(), }
func BuildSignedMessage ¶
func BuildSignedMessage(msg *Message, signature crypto.Signature) (*SignedMessage, error)
func (*SignedMessage) String ¶
func (m *SignedMessage) String() string
Click to show internal directories.
Click to hide internal directories.