messager

package
v1.3.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2022 License: Apache-2.0, MIT Imports: 9 Imported by: 26

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddressStateToString

func AddressStateToString(state AddressState) string

func MessageStateToString

func MessageStateToString(state MessageState) string

Types

type Address

type Address struct {
	ID   types.UUID      `json:"id"`
	Addr address.Address `json:"addr"`
	//max for current, use nonce and +1
	Nonce  uint64 `json:"nonce"`
	Weight int64  `json:"weight"`
	// number of address selection messages
	SelMsgNum         uint64       `json:"selMsgNum"`
	State             AddressState `json:"state"`
	GasOverEstimation float64      `json:"gasOverEstimation"`
	MaxFee            big.Int      `json:"maxFee,omitempty"`
	MaxFeeCap         big.Int      `json:"maxFeeCap"`

	IsDeleted int       `json:"isDeleted"` // 是否删除 1:是  -1:否
	CreatedAt time.Time `json:"createAt"`  // 创建时间
	UpdatedAt time.Time `json:"updateAt"`  // 更新时间
}

type AddressState

type AddressState int
const (
	AddressStateAlive AddressState
	AddressStateRemoving
	AddressStateRemoved
	AddressStateForbbiden // forbbiden received message
)

func (AddressState) String

func (as AddressState) String() string

type Message

type Message struct {
	ID string

	UnsignedCid *cid.Cid
	SignedCid   *cid.Cid
	shared.Message
	Signature *crypto.Signature

	Height     int64
	Confidence int64
	Receipt    *shared.MessageReceipt
	TipSetKey  shared.TipSetKey
	Meta       *SendSpec
	WalletName string
	FromUser   string

	State MessageState

	CreatedAt time.Time
	UpdatedAt time.Time
}

func FromUnsignedMessage

func FromUnsignedMessage(unsignedMsg shared.Message) *Message

func (*Message) MarshalJSON

func (m *Message) MarshalJSON() ([]byte, error)

todo ignore use message MarshalJSON method

type MessageState

type MessageState int
const (
	UnKnown MessageState = iota
	UnFillMsg
	FillMsg
	OnChainMsg
	FailedMsg
	ReplacedMsg
	NoWalletMsg
)

func (MessageState) String

func (mst MessageState) String() string

type MessageWithUID

type MessageWithUID struct {
	UnsignedMessage shared.Message
	ID              string
}

type Node

type Node struct {
	ID types.UUID

	Name  string
	URL   string
	Token string
	Type  NodeType
}

type NodeType

type NodeType int
const (
	FullNode NodeType
	LightNode
)

type QuickSendParams

type QuickSendParams struct {
	To      address.Address
	From    address.Address
	Val     abi.TokenAmount
	Account string

	GasPremium *abi.TokenAmount
	GasFeeCap  *abi.TokenAmount
	GasLimit   *int64

	Method     abi.MethodNum
	Params     string
	ParamsType QuickSendParamsCodec // json or hex
}

type QuickSendParamsCodec

type QuickSendParamsCodec string
const (
	QuickSendParamsCodecJSON QuickSendParamsCodec = "json"
	QuickSendParamsCodecHex  QuickSendParamsCodec = "hex"
)

type SendSpec

type SendSpec struct {
	ExpireEpoch       abi.ChainEpoch `json:"expireEpoch"`
	GasOverEstimation float64        `json:"gasOverEstimation"`
	MaxFee            big.Int        `json:"maxFee,omitempty"`
	MaxFeeCap         big.Int        `json:"maxFeeCap"`
}

type SharedSpec

type SharedSpec struct {
	ID uint `json:"id"`

	GasOverEstimation float64 `json:"gasOverEstimation"`
	MaxFee            big.Int `json:"maxFee,omitempty"`
	MaxFeeCap         big.Int `json:"maxFeeCap"`

	SelMsgNum uint64 `json:"selMsgNum"`
}

func (*SharedSpec) GetSendSpec

func (ss *SharedSpec) GetSendSpec() *SendSpec

Jump to

Keyboard shortcuts

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