reject

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountAdjustmentBatchError

type AccountAdjustmentBatchError struct {
	Rejects               []Reject
	FailedAdjustmentIndex int
}

func NewAccountAdjustmentBatchErrorFromHandle

func NewAccountAdjustmentBatchErrorFromHandle(
	reject native.AccountAdjustmentBatchError,
) (AccountAdjustmentBatchError, error)

type Code

type Code native.RejectCode
const (
	CodeMissingRequiredField        Code = native.RejectCodeMissingRequiredField
	CodeInvalidFieldFormat          Code = native.RejectCodeInvalidFieldFormat
	CodeInvalidFieldValue           Code = native.RejectCodeInvalidFieldValue
	CodeUnsupportedOrderType        Code = native.RejectCodeUnsupportedOrderType
	CodeUnsupportedTimeInForce      Code = native.RejectCodeUnsupportedTimeInForce
	CodeUnsupportedOrderAttribute   Code = native.RejectCodeUnsupportedOrderAttribute
	CodeDuplicateClientOrderID      Code = native.RejectCodeDuplicateClientOrderID
	CodeTooLateToEnter              Code = native.RejectCodeTooLateToEnter
	CodeExchangeClosed              Code = native.RejectCodeExchangeClosed
	CodeUnknownInstrument           Code = native.RejectCodeUnknownInstrument
	CodeUnknownAccount              Code = native.RejectCodeUnknownAccount
	CodeUnknownVenue                Code = native.RejectCodeUnknownVenue
	CodeUnknownClearingAccount      Code = native.RejectCodeUnknownClearingAccount
	CodeUnknownCollateralAsset      Code = native.RejectCodeUnknownCollateralAsset
	CodeInsufficientFunds           Code = native.RejectCodeInsufficientFunds
	CodeInsufficientMargin          Code = native.RejectCodeInsufficientMargin
	CodeInsufficientPosition        Code = native.RejectCodeInsufficientPosition
	CodeCreditLimitExceeded         Code = native.RejectCodeCreditLimitExceeded
	CodeRiskLimitExceeded           Code = native.RejectCodeRiskLimitExceeded
	CodeOrderExceedsLimit           Code = native.RejectCodeOrderExceedsLimit
	CodeOrderQtyExceedsLimit        Code = native.RejectCodeOrderQtyExceedsLimit
	CodeOrderNotionalExceedsLimit   Code = native.RejectCodeOrderNotionalExceedsLimit
	CodePositionLimitExceeded       Code = native.RejectCodePositionLimitExceeded
	CodeConcentrationLimitExceeded  Code = native.RejectCodeConcentrationLimitExceeded
	CodeLeverageLimitExceeded       Code = native.RejectCodeLeverageLimitExceeded
	CodeRateLimitExceeded           Code = native.RejectCodeRateLimitExceeded
	CodePnlKillSwitchTriggered      Code = native.RejectCodePnlKillSwitchTriggered
	CodeAccountBlocked              Code = native.RejectCodeAccountBlocked
	CodeAccountNotAuthorized        Code = native.RejectCodeAccountNotAuthorized
	CodeComplianceRestriction       Code = native.RejectCodeComplianceRestriction
	CodeInstrumentRestricted        Code = native.RejectCodeInstrumentRestricted
	CodeJurisdictionRestriction     Code = native.RejectCodeJurisdictionRestriction
	CodeWashTradePrevention         Code = native.RejectCodeWashTradePrevention
	CodeSelfMatchPrevention         Code = native.RejectCodeSelfMatchPrevention
	CodeShortSaleRestriction        Code = native.RejectCodeShortSaleRestriction
	CodeRiskConfigurationMissing    Code = native.RejectCodeRiskConfigurationMissing
	CodeReferenceDataUnavailable    Code = native.RejectCodeReferenceDataUnavailable
	CodeOrderValueCalculationFailed Code = native.RejectCodeOrderValueCalculationFailed
	CodeSystemUnavailable           Code = native.RejectCodeSystemUnavailable
	CodeCustom                      Code = native.RejectCodeCustom
	CodeOther                       Code = native.RejectCodeOther
)

type Reject

type Reject struct {
	// Human-readable reject reason.
	Reason string
	// Case-specific reject details.
	Details string
	// Policy name that produced the reject.
	Policy string
	// Opaque caller-defined payload copied through reject paths.
	//
	// Nil means "not set". Ownership and lifecycle are caller-managed.
	UserData unsafe.Pointer
	// Stable machine-readable reject code.
	Code Code
	// Reject scope.
	Scope Scope
}

func New

func New(
	code Code,
	policy string,
	reason string,
	details string,
	scope Scope,
) Reject

func NewFromHandle

func NewFromHandle(handle native.Reject) Reject

NewFromHandle creates a Reject from a Reject handle with data copied from the handle.

func NewList

func NewList(rejects ...Reject) []Reject

func NewListFromHandle

func NewListFromHandle(handle native.RejectList) ([]Reject, error)

func NewSingleItemList

func NewSingleItemList(
	code Code,
	policy string,
	reason string,
	details string,
	scope Scope,
) []Reject

func (Reject) NewHandle

func (r Reject) NewHandle() native.Reject

NewHandle returns a native Reject handle that refers to the current Reject data.

func (Reject) WithUserData

func (r Reject) WithUserData(userData unsafe.Pointer) Reject

WithUserData returns a copy of Reject with updated UserData.

Uses copy-on-write semantics. Original instance is unchanged.

Caller manages lifetime of userData.

type Scope

type Scope uint8
const (
	ScopeOrder   Scope = native.RejectScopeOrder
	ScopeAccount Scope = native.RejectScopeAccount
)

Jump to

Keyboard shortcuts

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