commands

package
v0.78.7 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: AGPL-3.0 Imports: 21 Imported by: 2

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")
	ErrMustBeAtMost200                                 = errors.New("must be at most 200")
	ErrMustBeAtMost2048                                = errors.New("must be at most 2048")
	ErrMustBeWithinRange7                              = errors.New("must be between -7 and 7")
	ErrIsNotValid                                      = errors.New("is not a valid value")
	ErrIsNotValidWithOCO                               = errors.New("is not a valid with one cancel other")
	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")
	ErrMustBeLessThan200Chars                          = errors.New("must be less than 200 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")
	ErrIsNotValidVegaPubkey                            = errors.New("is not a valid vega public key")
	ErrIsNotValidEthereumAddress                       = errors.New("is not a valid ethereum address")
	ErrEmptyEthereumCallSpec                           = errors.New("ethereum call spec is required")
	ErrInvalidEthereumAbi                              = errors.New("is not a valid ethereum abi definition")
	ErrInvalidEthereumCallTrigger                      = errors.New("ethereum call trigger not valid")
	ErrInvalidEthereumCallArgs                         = errors.New("ethereum call arguments not valid")
	ErrInvalidEthereumFilters                          = errors.New("ethereum call filters not valid")
	ErrInvalidEthereumCallSpec                         = errors.New("ethereum call spec is not valid")
	ErrMustBeWithinRange01                             = errors.New("must be between 0 and 1")
	ErrMustBeWithinRange11                             = errors.New("must be between -1 and 1")
	ErrMustBeLTE1                                      = errors.New("must be less than or equal to 1")
	ErrMustBeGTE1                                      = errors.New("must be greater than or equal to 1")
	ErrMustBeReduceOnly                                = errors.New("must be reduce only")
	ErrExpiryStrategyRequiredWhenExpiresAtSet          = errors.New("expiry strategy required when expires_at set")
	ErrMustHaveAtLeastOneOfRisesAboveOrFallsBelow      = errors.New("must have at least one of rises above or falls below")
	ErrMustHaveAStopOrderTrigger                       = errors.New("must have a stop order trigger")
	ErrFallsBelowAndRiseAboveMarketIDMustBeTheSame     = errors.New("market ID for falls below and rises above must be the same")
	ErrTrailingPercentOffsetMinimalIncrementNotReached = errors.New("trailing percent offset minimal increment must be >= 0.001")
	ErrMustBeEmpty                                     = errors.New("must be empty")
	ErrMustBeGTEClampLowerBound                        = errors.New("must be greater than or equal to clamp lower bound")
	ErrOneTimeTriggerAllowedMax                        = errors.New("maximum one time trigger allowed")
	ErrMustBeBetween01                                 = errors.New("must be between 0 (excluded) and 1 (included)")
	ErrMustBeGreaterThanEnactmentTimestamp             = errors.New("must be greater than proposal_submission.terms.enactment_timestamp")
	ErrMustBeLessThen366                               = errors.New("must be less then 366")
	ErrMustBeAtMost500                                 = errors.New("must be at most 500")
	ErrMustBeSetTo0IfSizeSet                           = errors.New("must be set to 0 if the property \"order_amendment.size\" is set")
	ErrMustBeAtMost3600                                = errors.New("must be at most 3600")
	ErrMustBeWithinRangeGT0LT20                        = errors.New("price range must be strictly greater than 0 and less than or equal to 20")
	ErrSizeIsTooLarge                                  = errors.New("size is too large")
	ErrCannotSetAllowListWhenTeamIsOpened              = errors.New("cannot set allow list when team is opened")
	ErrSettingAllowListRequireSettingClosedState       = errors.New("setting an allow list requires setting the closed state")
	ErrIsLimitedTo32Characters                         = errors.New("is limited to 32 characters")
	ErrIsLimitedTo10Entries                            = errors.New("is limited to 10 entries")
	ErrIsLimitedTo255Characters                        = errors.New("is limited to 255 characters")
	ErrCannotBeBlank                                   = errors.New("cannot be blank")
	ErrIsDuplicated                                    = errors.New("is duplicated")
	ErrIsDisabled                                      = errors.New("is disabled")
	ErrMustBeAtMost250                                 = errors.New("must be at most 250")
	ErrNoUpdatesProvided                               = errors.New("no updates provided")
	ErrMaxPriceMustRespectTickSize                     = errors.New("must respect tick size")
)
View Source
var (
	ErrShouldBeAValidVegaPublicKey = errors.New("should be a valid vega public key")
	ErrShouldBeAValidVegaID        = errors.New("should be a valid Vega 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 added in v0.56.0

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

func CheckAmendAMM added in v0.77.0

func CheckAmendAMM(cmd *commandspb.AmendAMM) error

func CheckAnnounceNode

func CheckAnnounceNode(cmd *commandspb.AnnounceNode) error

func CheckApplyReferralCode added in v0.73.0

func CheckApplyReferralCode(cmd *commandspb.ApplyReferralCode) error

func CheckBatchMarketInstructions added in v0.55.0

func CheckBatchMarketInstructions(cmd *commandspb.BatchMarketInstructions) error

func CheckBatchProposalSubmission added in v0.74.0

func CheckBatchProposalSubmission(cmd *commandspb.BatchProposalSubmission) error

func CheckCancelAMM added in v0.77.0

func CheckCancelAMM(cmd *commandspb.CancelAMM) error

func CheckCancelTransfer

func CheckCancelTransfer(cmd *commandspb.CancelTransfer) error

func CheckChainEvent

func CheckChainEvent(cmd *commandspb.ChainEvent) error

func CheckCreateReferralSet added in v0.73.0

func CheckCreateReferralSet(cmd *commandspb.CreateReferralSet) error

func CheckDelegateSubmission

func CheckDelegateSubmission(cmd *commandspb.DelegateSubmission) error

func CheckEthereumKeyRotateSubmission

func CheckEthereumKeyRotateSubmission(cmd *commandspb.EthereumKeyRotateSubmission) error

func CheckIssueSignatures added in v0.55.0

func CheckIssueSignatures(cmd *commandspb.IssueSignatures) error

func CheckJoinTeam added in v0.74.0

func CheckJoinTeam(cmd *commandspb.JoinTeam) 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 CheckStopOrdersCancellation added in v0.72.0

func CheckStopOrdersCancellation(cmd *commandspb.StopOrdersCancellation) error

func CheckStopOrdersSubmission added in v0.72.0

func CheckStopOrdersSubmission(cmd *commandspb.StopOrdersSubmission) error

func CheckSubmitAMM added in v0.77.0

func CheckSubmitAMM(cmd *commandspb.SubmitAMM) 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 CheckUpdateMarginMode added in v0.74.0

func CheckUpdateMarginMode(cmd *commandspb.UpdateMarginMode) error

func CheckUpdatePartyProfile added in v0.74.0

func CheckUpdatePartyProfile(cmd *commandspb.UpdatePartyProfile) error

func CheckUpdateReferralSet added in v0.73.0

func CheckUpdateReferralSet(cmd *commandspb.UpdateReferralSet) 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 IsVegaID added in v0.73.0

func IsVegaID(id string) bool

IsVegaID check if a string is a valid Vega public key. An ID is a string of 64 characters containing only hexadecimal characters. Despite being similar to the function IsVegaPublicKey, the Vega ID and public key are different concept that generated, and used differently.

func IsVegaPublicKey added in v0.73.0

func IsVegaPublicKey(key string) bool

IsVegaPublicKey check if a string is a valid Vega public key. A public key is a string of 64 characters containing only hexadecimal characters. Despite being similar to the function IsVegaID, the Vega ID and public key are different concept that generated, and used differently.

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 added in v0.63.0

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) AddPrefix added in v0.74.0

func (e Errors) AddPrefix(prefix string) Errors

AddPrefix adds prefix to each 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