messager

package
v1.10.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 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"`
	GasFeeCap         big.Int      `json:"gasFeeCap"`
	GasOverPremium    float64      `json:"gasOverPremium"`
	BaseFee           big.Int      `json:"baseFee"`

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

type AddressSpec added in v1.8.0

type AddressSpec struct {
	Address           address.Address `json:"address"`
	GasOverEstimation float64         `json:"gasOverEstimation"`
	GasOverPremium    float64         `json:"gasOverPremium"`
	MaxFeeStr         string          `json:"maxFeeStr"`
	GasFeeCapStr      string          `json:"gasFeeCapStr"`
	BaseFeeStr        string          `json:"baseFeeStr"`
}

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

	State MessageState

	// Error is set if the message failed to fill
	ErrorMsg string

	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
	NonceConflictMsg
)

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 ReplacMessageParams added in v1.6.1

type ReplacMessageParams struct {
	ID             string
	Auto           bool
	MaxFee         abi.TokenAmount
	GasLimit       int64
	GasPremium     abi.TokenAmount
	GasFeecap      abi.TokenAmount
	GasOverPremium float64
}

type SendSpec

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

type SharedSpec

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

	GasOverEstimation float64 `json:"gasOverEstimation"`
	MaxFee            big.Int `json:"maxFee,omitempty"`
	GasFeeCap         big.Int `json:"gasFeeCap"`
	GasOverPremium    float64 `json:"gasOverPremium"`
	BaseFee           big.Int `json:"baseFee"`

	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