commands

package
v0.0.0-...-589da53 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const ChainIDDelimiter = '\000'
View Source
const ReferenceMaxLen int = 100

Variables

View Source
var (
	ErrIsRequired                   = errors.New("is required")
	ErrMustBePositive               = errors.New("must be positive")
	ErrMustBePositiveOrZero         = errors.New("must be positive or zero")
	ErrMustBeNegativeOrZero         = errors.New("must be negative or zero")
	ErrMustBeLessThan150            = errors.New("must be less than 150")
	ErrMustBeAtMost1M               = errors.New("must be at most 1000000")
	ErrMustBeAtMost100              = errors.New("must be at most 100")
	ErrMustBeWithinRange7           = errors.New("must be between -7 and 7")
	ErrIsNotValid                   = errors.New("is not a valid value")
	ErrIsNotValidNumber             = errors.New("is not a valid number")
	ErrIsNotSupported               = errors.New("is not supported")
	ErrIsUnauthorised               = errors.New("is unauthorised")
	ErrCannotAmendToGFA             = errors.New("cannot amend to time in force GFA")
	ErrCannotAmendToGFN             = errors.New("cannot amend to time in force GFN")
	ErrNonGTTOrderWithExpiry        = errors.New("non GTT order with expiry")
	ErrGTTOrderWithNoExpiry         = errors.New("GTT order without expiry")
	ErrIsMismatching                = errors.New("is mismatching")
	ErrReferenceTooLong             = errors.New("reference is too long")
	ErrNotAValidInteger             = errors.New("not a valid integer")
	ErrNotAValidFloat               = errors.New("not a valid float")
	ErrMustBeLessThan100Chars       = errors.New("must be less than 100 characters")
	ErrMustNotExceed20000Chars      = errors.New("must not exceed 20000 characters")
	ErrShouldBeHexEncoded           = errors.New("should be hex encoded")
	ErrSignatureNotVerifiable       = errors.New("signature is not verifiable")
	ErrInvalidSignature             = errors.New("invalid signature")
	ErrUnsupportedAlgorithm         = errors.New("unsupported algorithm")
	ErrEmptyBatchMarketInstructions = errors.New("empty batch market instructions")
	ErrIsNotValidFuryPubkey         = errors.New("is not a valid fury public key")
	ErrIsNotValidEthereumAddress    = errors.New("is not a valid ethereum address")
)
View Source
var (
	ErrShouldBeAValidFuryPubkey = errors.New("should be a valid fury public key")
	ErrShouldBeAValidFuryID     = errors.New("should be a valid fury ID")
)
View Source
var (
	ErrOrderInShapeWithoutReference         = errors.New("order in shape without reference")
	ErrOrderInShapeWithoutProportion        = errors.New("order in shape without a proportion")
	ErrOrderInBuySideShapeWithBestAskPrice  = errors.New("order in buy side shape with best ask price reference")
	ErrOrderInBuySideShapeOffsetInf0        = errors.New("order in buy side shape offset must be >= 0")
	ErrOrderInBuySideShapeOffsetInfEq0      = errors.New("order in buy side shape offset must be > 0")
	ErrOrderInSellSideShapeOffsetInf0       = errors.New("order in sell shape offset must be >= 0")
	ErrOrderInSellSideShapeWithBestBidPrice = errors.New("order in sell side shape with best bid price reference")
	ErrOrderInSellSideShapeOffsetInfEq0     = errors.New("order in sell shape offset must be > 0")
)
View Source
var (
	ErrMustBeAfterStartEpoch = errors.New("must be after start_epoch")
	ErrUnknownAsset          = errors.New("unknown asset")
)

Functions

func BundleInputDataForSigning

func BundleInputDataForSigning(inputDataBytes []byte, chainID string) []byte

func CheckAnnounceNode

func CheckAnnounceNode(cmd *commandspb.AnnounceNode) error

func CheckBatchMarketInstructions

func CheckBatchMarketInstructions(cmd *commandspb.BatchMarketInstructions) error

func CheckCancelTransfer

func CheckCancelTransfer(cmd *commandspb.CancelTransfer) error

func CheckChainEvent

func CheckChainEvent(cmd *commandspb.ChainEvent) error

func CheckDelegateSubmission

func CheckDelegateSubmission(cmd *commandspb.DelegateSubmission) error

func CheckEthereumKeyRotateSubmission

func CheckEthereumKeyRotateSubmission(cmd *commandspb.EthereumKeyRotateSubmission) error

func CheckIssueSignatures

func CheckIssueSignatures(cmd *commandspb.IssueSignatures) error

func CheckKeyRotateSubmission

func CheckKeyRotateSubmission(cmd *commandspb.KeyRotateSubmission) error

func CheckLiquidityProvisionAmendment

func CheckLiquidityProvisionAmendment(cmd *commandspb.LiquidityProvisionAmendment) error

func CheckLiquidityProvisionCancellation

func CheckLiquidityProvisionCancellation(cmd *commandspb.LiquidityProvisionCancellation) error

func CheckLiquidityProvisionSubmission

func CheckLiquidityProvisionSubmission(cmd *commandspb.LiquidityProvisionSubmission) error

func CheckNodeSignature

func CheckNodeSignature(cmd *commandspb.NodeSignature) error

func CheckNodeVote

func CheckNodeVote(cmd *commandspb.NodeVote) error

func CheckOracleDataSubmission

func CheckOracleDataSubmission(cmd *commandspb.OracleDataSubmission) error

func CheckOrderAmendment

func CheckOrderAmendment(cmd *commandspb.OrderAmendment) error

func CheckOrderCancellation

func CheckOrderCancellation(cmd *commandspb.OrderCancellation) error

func CheckOrderSubmission

func CheckOrderSubmission(cmd *commandspb.OrderSubmission) error

func CheckProposalSubmission

func CheckProposalSubmission(cmd *commandspb.ProposalSubmission) error

func CheckProtocolUpgradeProposal

func CheckProtocolUpgradeProposal(cmd *commandspb.ProtocolUpgradeProposal) error

func CheckStateVariableProposal

func CheckStateVariableProposal(cmd *commandspb.StateVariableProposal) error

func CheckTransaction

func CheckTransaction(tx *commandspb.Transaction, chainID string) (*commandspb.InputData, error)

func CheckTransfer

func CheckTransfer(cmd *commandspb.Transfer) error

func CheckUndelegateSubmission

func CheckUndelegateSubmission(cmd *commandspb.UndelegateSubmission) error

func CheckValidatorHeartbeat

func CheckValidatorHeartbeat(cmd *commandspb.ValidatorHeartbeat) error

func CheckVoteSubmission

func CheckVoteSubmission(cmd *commandspb.VoteSubmission) error

func CheckWithdrawSubmission

func CheckWithdrawSubmission(cmd *commandspb.WithdrawSubmission) error

func IsFuryPubkey

func IsFuryPubkey(pk string) bool

IsFuryPubkey check if a string is a valid fury public key. A fury public key is a string of 64 characters containing only hexadecimal characters.

func MarshalInputData

func MarshalInputData(inputData *commandspb.InputData) ([]byte, error)

func NewInputData

func NewInputData(height uint64) *commandspb.InputData

func NewSignature

func NewSignature(sig []byte, algo string, version uint32) *commandspb.Signature

func NewTransaction

func NewTransaction(pubKey string, data []byte, signature *commandspb.Signature) *commandspb.Transaction

func UnmarshalInputData

func UnmarshalInputData(rawInputData []byte) (*commandspb.InputData, error)

Types

type Errors

type Errors map[string][]error

func CheckInputData

func CheckInputData(rawInputData []byte) (*commandspb.InputData, Errors)

func CheckNewFreeformChanges

func CheckNewFreeformChanges(change *protoTypes.ProposalTerms_NewFreeform) Errors

func NewErrors

func NewErrors() Errors

func (Errors) Add

func (e Errors) Add(err error)

Add adds a general error that is not related to a specific property.

func (Errors) AddForProperty

func (e Errors) AddForProperty(prop string, err error)

AddForProperty adds an error for a given property.

func (Errors) Empty

func (e Errors) Empty() bool

func (Errors) Error

func (e Errors) Error() string

func (Errors) ErrorOrNil

func (e Errors) ErrorOrNil() error

func (Errors) FinalAdd

func (e Errors) FinalAdd(err error) Errors

FinalAdd behaves like Add, but is meant to be called in a "return" statement. This helper is usually used for terminal errors.

func (Errors) FinalAddForProperty

func (e Errors) FinalAddForProperty(prop string, err error) Errors

FinalAddForProperty behaves like AddForProperty, but is meant to be called in a "return" statement. This helper is usually used for terminal errors.

func (Errors) Get

func (e Errors) Get(prop string) []error

func (Errors) MarshalJSON

func (e Errors) MarshalJSON() ([]byte, error)

func (Errors) Merge

func (e Errors) Merge(oth Errors)

Jump to

Keyboard shortcuts

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