submodel

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Dealing = BondState("Dealing")
	Fail    = BondState("Fail")
	Success = BondState("Success")
	Default = BondState("Default")
)
View Source
const (
	BondReasonDefault = BondReason("Default")
	Pass              = BondReason("Pass")
	BlockhashUnmatch  = BondReason("BlockhashUnmatch")
	TxhashUnmatch     = BondReason("TxhashUnmatch")
	PubkeyUnmatch     = BondReason("PubkeyUnmatch")
	PoolUnmatch       = BondReason("PoolUnmatch")
	AmountUnmatch     = BondReason("AmountUnmatch")
)
View Source
const (
	Initiated = RproposalStatus("Initiated")
	Approved  = RproposalStatus("Approved")
	Rejected  = RproposalStatus("Rejected")
	Expired   = RproposalStatus("Expired")
)
View Source
const (
	EraUpdated       = PoolBondState("EraUpdated")
	BondReported     = PoolBondState("BondReported")
	ActiveReported   = PoolBondState("ActiveReported")
	WithdrawSkipped  = PoolBondState("WithdrawSkipped")
	WithdrawReported = PoolBondState("WithdrawReported")
	TransferReported = PoolBondState("TransferReported")
)
View Source
const (
	BondOnly         = BondAction("BondOnly")
	UnbondOnly       = BondAction("UnbondOnly")
	BothBondUnbond   = BondAction("BothBondUnbond")
	EitherBondUnbond = BondAction("EitherBondUnbond")
	InterDeduct      = BondAction("InterDeduct")
)
View Source
const (
	NewBondReport                       = BondReportType(0)
	BondAndReportActive                 = BondReportType(1)
	BondAndReportActiveWithPendingValue = BondReportType(2)
)
View Source
const (
	OriginalTxDefault      = OriginalTx("default")
	OriginalTransfer       = OriginalTx("Transfer") //transfer
	OriginalBond           = OriginalTx("Bond")     //bond or unbond
	OriginalUnbond         = OriginalTx("Unbond")
	OriginalWithdrawUnbond = OriginalTx("WithdrawUnbond") //redelegate: validator update
	OriginalClaimRewards   = OriginalTx("ClaimRewards")   // claim
)
View Source
const (
	RFIS   = RSymbol("RFIS")
	RDOT   = RSymbol("RDOT")
	RKSM   = RSymbol("RKSM")
	RATOM  = RSymbol("RATOM")
	RSOL   = RSymbol("RSOL")
	RMATIC = RSymbol("RMATIC")
	RBNB   = RSymbol("RBNB")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountInfo

type AccountInfo struct {
	Nonce     uint32
	Consumers uint32
	Providers uint32
	Data      struct {
		Free       types.U128
		Reserved   types.U128
		MiscFrozen types.U128
		FreeFrozen types.U128
	}
}

type ActiveReportedFlow

type ActiveReportedFlow struct {
	Symbol        RSymbol
	ShotId        types.Hash
	LastVoter     types.AccountID
	LastVoterFlag bool
	Snap          *PoolSnapshot
}

type BondAction

type BondAction string

func (*BondAction) Decode

func (ba *BondAction) Decode(decoder scale.Decoder) error

func (BondAction) Encode

func (ba BondAction) Encode(encoder scale.Encoder) error

type BondCall

type BondCall struct {
	ReportType BondReportType
	Action     BondAction
}

type BondFlow

type BondFlow struct {
	Symbol      RSymbol
	BondId      types.Hash
	Record      *BondRecord
	Reason      BondReason
	State       BondState
	VerifyTimes int
}

type BondReason

type BondReason string

func (*BondReason) Decode

func (br *BondReason) Decode(decoder scale.Decoder) error

func (BondReason) Encode

func (br BondReason) Encode(encoder scale.Encoder) error

type BondRecord

type BondRecord struct {
	Bonder    types.AccountID
	Symbol    RSymbol
	Pubkey    types.Bytes
	Pool      types.Bytes
	Blockhash types.Bytes
	Txhash    types.Bytes
	Amount    types.U128
}

type BondReportType

type BondReportType uint8

type BondState

type BondState string

func (*BondState) Decode

func (bs *BondState) Decode(decoder scale.Decoder) error

func (BondState) Encode

func (bs BondState) Encode(encoder scale.Encoder) error

type BondStateKey

type BondStateKey struct {
	BlockHash types.Bytes
	TxHash    types.Bytes
}

type ChainEvent

type ChainEvent struct {
	ModuleId string                  `json:"module_id" `
	EventId  string                  `json:"event_id" `
	Params   []scalecodec.EventParam `json:"params"`
}

type Era

type Era struct {
	Type  string `json:"type"`
	Value uint32 `json:"value"`
}

type EraPoolUpdatedFlow

type EraPoolUpdatedFlow struct {
	Symbol        RSymbol
	Era           uint32
	ShotId        types.Hash
	LastVoter     types.AccountID
	LastVoterFlag bool
	Snap          *PoolSnapshot
	LeastBond     *big.Int
	BondCall      *BondCall
	Active        *big.Int
	Reward        *big.Int
	PendingStake  *big.Int // rBNB use
	PendingReward *big.Int // rBNB use
}

type EraRewardPoints

type EraRewardPoints struct {
	Total       uint32
	Individuals []Individual
}

type EventMultisigExecuted

type EventMultisigExecuted struct {
	Who, ID     types.AccountID
	TimePoint   types.TimePoint
	CallHash    types.Hash
	CallHashStr string
	Result      bool
}

type EventNewMultisig

type EventNewMultisig struct {
	Who, ID     types.AccountID
	CallHash    types.Hash
	CallHashStr string
	TimePoint   *OptionTimePoint
	Approvals   []types.AccountID
}

type EvtLiquidityBond

type EvtLiquidityBond struct {
	AccountId types.AccountID
	Symbol    RSymbol
	BondId    types.Hash
}

type EvtSignatureEnough

type EvtSignatureEnough struct {
	RSymbol    RSymbol
	Era        uint32
	Pool       []byte
	TxType     OriginalTx
	ProposalId []byte
}

SignaturesEnough(RSymbol, u32, Vec<u8>, OriginalTxType, Vec<u8>),

type ExeLiquidityBondAndSwapFlow

type ExeLiquidityBondAndSwapFlow struct {
	Pool           types.Bytes
	Blockhash      types.Bytes
	Txhash         types.Bytes
	Amount         types.U128
	Symbol         RSymbol
	StafiRecipient types.AccountID
	DestRecipient  types.Bytes
	DestId         types.U8
	Reason         BondReason
}

execute_bond_and_swap(origin, pool: Vec<u8>, blockhash: Vec<u8>, txhash: Vec<u8>, amount: u128, symbol: RSymbol, stafi_recipient: T::AccountId, dest_recipient: Vec<u8>, dest_id: ChainId, reason: BondReason)

type Exposure

type Exposure struct {
	Total  types.UCompact
	Own    types.UCompact
	Others []IndividualExposure
}

type GetBondStateFlow

type GetBondStateFlow struct {
	Symbol    RSymbol
	BlockHash types.Bytes
	TxHash    types.Bytes
	BondState chan BondState
}

type GetEraNominatedFlow

type GetEraNominatedFlow struct {
	Symbol        RSymbol
	Pool          []byte
	Era           uint32
	NewValidators chan []types.AccountID
}

type GetPoolThresholdFlow

type GetPoolThresholdFlow struct {
	Symbol    RSymbol
	Pool      types.Bytes
	Threshold chan uint32
}

type GetReceiversParams

type GetReceiversParams struct {
	Symbol RSymbol
	Era    types.U32
	Pool   types.Bytes
}

type GetSubmitSignaturesFlow

type GetSubmitSignaturesFlow struct {
	Symbol     RSymbol
	Era        types.U32
	Pool       types.Bytes
	TxType     OriginalTx
	ProposalId types.Bytes
	Signatures chan []types.Bytes
}

type Individual

type Individual struct {
	Validator   types.AccountID
	RewardPoint uint32
}

type IndividualExposure

type IndividualExposure struct {
	Who   types.AccountID
	Value types.UCompact
}

type MultiCallParam

type MultiCallParam struct {
	TimePoint *OptionTimePoint
	Opaque    []byte
	Extrinsic string
	CallHash  string
}

type MultiOpaqueCall

type MultiOpaqueCall struct {
	Extrinsic string
	Opaque    []byte
	CallHash  string
	TimePoint *OptionTimePoint
}

type Multisig

type Multisig struct {
	When      types.TimePoint
	Deposit   types.U128
	Depositor types.AccountID
	Approvals []types.AccountID
}

type NominationUpdatedFlow

type NominationUpdatedFlow struct {
	Symbol        RSymbol
	Pool          []byte
	NewValidators []types.Bytes
	Era           uint32
	LastVoter     types.AccountID
	LastVoterFlag bool
}

type OptionTimePoint

type OptionTimePoint struct {
	// contains filtered or unexported fields
}

func NewOptionTimePoint

func NewOptionTimePoint(value types.TimePoint) *OptionTimePoint

func NewOptionTimePointEmpty

func NewOptionTimePointEmpty() *OptionTimePoint

func (*OptionTimePoint) Decode

func (o *OptionTimePoint) Decode(decoder scale.Decoder) error

func (OptionTimePoint) Encode

func (o OptionTimePoint) Encode(encoder scale.Encoder) error

func (OptionTimePoint) IsNone

func (o OptionTimePoint) IsNone() bool

IsNone returns true if the value is missing

func (OptionTimePoint) IsSome

func (o OptionTimePoint) IsSome() bool

IsNone returns true if a value is present

func (*OptionTimePoint) SetNone

func (o *OptionTimePoint) SetNone()

SetNone removes a value and marks it as missing

func (*OptionTimePoint) SetSome

func (o *OptionTimePoint) SetSome(value types.TimePoint)

SetSome sets a value

type OriginalTx

type OriginalTx string

func (*OriginalTx) Decode

func (r *OriginalTx) Decode(decoder scale.Decoder) error

func (OriginalTx) Encode

func (r OriginalTx) Encode(encoder scale.Encoder) error

type PoolBondState

type PoolBondState string

func (*PoolBondState) Decode

func (p *PoolBondState) Decode(decoder scale.Decoder) error

type PoolSnapshot

type PoolSnapshot struct {
	Symbol    RSymbol
	Era       uint32
	Pool      []byte
	Bond      types.U128
	Unbond    types.U128
	Active    types.U128
	LastVoter types.AccountID
	BondState PoolBondState
}

type PoolUnbondKey

type PoolUnbondKey struct {
	Pool []byte
	Era  uint32
}

type Proposal

type Proposal struct {
	Call       types.Call
	Symbol     RSymbol
	BondId     types.Hash
	MethodName string
}

func (*Proposal) Encode

func (p *Proposal) Encode() ([]byte, error)

encode takes only nonce and call and encodes them for storage queries

type RSymbol

type RSymbol string

func (*RSymbol) Decode

func (r *RSymbol) Decode(decoder scale.Decoder) error

func (RSymbol) Encode

func (r RSymbol) Encode(encoder scale.Encoder) error

type Receive

type Receive struct {
	Recipient []byte
	Value     types.UCompact
}

type RproposalStatus

type RproposalStatus string

func (*RproposalStatus) Decode

func (r *RproposalStatus) Decode(decoder scale.Decoder) error

type SignaturesKey

type SignaturesKey struct {
	Era        uint32
	Pool       []byte
	TxType     OriginalTx
	ProposalId []byte
}

type StakingLedger

type StakingLedger struct {
	Stash          types.AccountID
	Total          types.UCompact
	Active         types.UCompact
	Unlocking      []UnlockChunk
	ClaimedRewards []uint32
}

type SubmitSignatureParams

type SubmitSignatureParams struct {
	Symbol     RSymbol
	Era        types.U32
	Pool       types.Bytes
	TxType     OriginalTx
	ProposalId types.Bytes
	Signature  types.Bytes
}

func (*SubmitSignatureParams) EncodeToHash

func (ssp *SubmitSignatureParams) EncodeToHash() (common.Hash, error)

type SubmitSignatures

type SubmitSignatures struct {
	Symbol     RSymbol
	Era        types.U32
	Pool       types.Bytes
	TxType     OriginalTx
	ProposalId types.Bytes
	Signature  []types.Bytes
	Threshold  uint32
}

func (*SubmitSignatures) EncodeToHash

func (ss *SubmitSignatures) EncodeToHash() (common.Hash, error)

type Transaction

type Transaction struct {
	ExtrinsicHash  string
	CallModuleName string
	CallName       string
	Address        interface{}
	Params         []commonTypes.ExtrinsicParam
}

type TransferReportedFlow

type TransferReportedFlow struct {
	Symbol        RSymbol
	ShotId        types.Hash
	Snap          *PoolSnapshot
	LastVoterFlag bool
	Receives      []*Receive
	TotalAmount   types.U128
}

type Unbonding

type Unbonding struct {
	Who       types.AccountID
	Value     types.U128
	Recipient []byte
}

type UnlockChunk

type UnlockChunk struct {
	Value types.UCompact
	Era   types.UCompact
}

type ValidatorUpdatedFlow

type ValidatorUpdatedFlow struct {
	Symbol       RSymbol
	Pool         []byte
	OldValidator types.Bytes
	NewValidator types.Bytes
	Era          uint32
}

type VoteState

type VoteState struct {
	VotesFor     []types.AccountID
	VotesAgainst []types.AccountID
	Status       RproposalStatus
}

type WithdrawReportedFlow

type WithdrawReportedFlow struct {
	Symbol        RSymbol
	ShotId        types.Hash
	LastVoter     types.AccountID
	LastVoterFlag bool
	Snap          *PoolSnapshot
	Receives      []*Receive
	TotalAmount   types.U128
}

Jump to

Keyboard shortcuts

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