utils

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OrderIdFlag       = "order-id"
	ProductIdFlag     = "product-id"
	GenericIdFlag     = "id"
	ActivityIdFlag    = "activity-id"
	TransactionIdFlag = "transaction-id"
	WalletIdFlag      = "wallet-id"

	AddressFlag       = "address"
	SymbolFlag        = "symbol"
	NameFlag          = "name"
	NetworkIdFlag     = "network-id"
	NetworkTypeFlag   = "network-type"
	NetworkFamilyFlag = "network-family"
	AccountIdFlag     = "account-identifier"
	TypeFlag          = "type"
	SideFlag          = "side"
	BaseQuantityFlag  = "base-quantity"
	QuoteValueFlag    = "quote-value"
	LimitPriceFlag    = "limit-price"
	StartTimeFlag     = "start-time"
	ExpiryTimeFlag    = "expiry-time"
	TimeInForceFlag   = "time-in-force"

	SourceWalletIdFlag      = "source-wallet-id"
	SourceSymbolFlag        = "source-symbol"
	DestinationWalletIdFlag = "destination-wallet-id"
	DestinationSymbolFlag   = "destination-symbol"
	AmountFlag              = "amount"
	DestinationTypeFlag     = "destination-type"
	DepositTypeFlag         = "deposit-type"

	AllocationIdFlag             = "allocation-id"
	NettingIdFlag                = "netting-id"
	SizeTypeFlag                 = "size-type"
	SourcePortfolioIdFlag        = "source-portfolio-id"
	RemainderDestPortfolioIdFlag = "remainder-destination-portfolio-id"
	OrderIdsFlag                 = "order-ids"
	AllocationLegsFlag           = "allocation-legs"

	PaymentMethodIdFlag   = "payment-method-id"
	BlockchainAddressFlag = "blockchain-address"
	AccountIdentifierFlag = "account-identifier"

	JsonIndent        = "  "
	SearchFlag        = "search"
	LimitFlag         = "limit"
	SortDirectionFlag = "sort-direction"

	SymbolsFlag       = "symbols"
	ActivityLevelFlag = "activity-level"
	CategoriesFlag    = "categories"
	StatusesFlag      = "statuses"
	StartFlag         = "start"
	EndFlag           = "end"
	ProductIdsFlag    = "product-ids"
	OrderStatusesFlag = "order-statuses"
	OrderTypeFlag     = "order-type"
	OrderSideFlag     = "order-side"
	TypesFlag         = "types"

	OrderStatusOpen = "OPEN"
	OrderTypeMarket = "MARKET"
	OrderTypeLimit  = "LIMIT"
	OrderTypeTwap   = "TWAP"
	OrderTypeVwap   = "VWAP"
	OrderSideBuy    = "BUY"
	OrderSideSell   = "SELL"

	InvoiceStatesFlag   = "states"
	InvoiceBillingYear  = "billing-year"
	InvoiceBillingMonth = "billing-month"

	TifFillOrKill         = "FILL_OR_KILL"
	TifGoodUntilDateTime  = "GOOD_UNTIL_DATE_TIME"
	TifGoodUntilCancelled = "GOOD_UNTIL_CANCELLED"
	TifImmediateOrCancel  = "IMMEDIATE_OR_CANCEL"

	FormatFlag      = "format"
	AllFlag         = "all"
	InteractiveFlag = "interactive"

	PortfolioIdFlag           = "portfolio-id"
	EntityIdFlag              = "entity-id"
	IdempotencyKeyFlag        = "idempotency-key"
	ClientOrderIdFlag         = "client-order-id"
	ClientQuoteIdFlag         = "client-quote-id"
	QuoteIdFlag               = "quote-id"
	SettleCurrencyFlag        = "settle-currency"
	DisableDynamicGasFlag     = "disable-dynamic-gas"
	ReplacedTransactionIdFlag = "replaced-transaction-id"
	LimitDefault              = "100"
	SortDirectionDefault      = "DESC"

	RawUnsignedTransactionFlag = "raw-unsigned-transaction"
	SkipBroadcastFlag          = "skip-broadcast"
	ChainIdFlag                = "chain-id"
	UrlFlag                    = "url"
)

Variables

This section is empty.

Functions

func AddActivityIdFlag added in v0.2.0

func AddActivityIdFlag(cmd *cobra.Command)

func AddBaseQuantityFlag added in v0.2.1

func AddBaseQuantityFlag(cmd *cobra.Command)

func AddClientOrderId added in v0.2.1

func AddClientOrderId(cmd *cobra.Command)

func AddEntityIdFlag added in v0.2.0

func AddEntityIdFlag(cmd *cobra.Command)

func AddIdempotencyKeyFlag added in v0.2.0

func AddIdempotencyKeyFlag(cmd *cobra.Command)

func AddLimitPriceFlag added in v0.2.1

func AddLimitPriceFlag(cmd *cobra.Command)

func AddOrderSideFlag added in v0.2.0

func AddOrderSideFlag(cmd *cobra.Command)

func AddOrderTypeFlag added in v0.2.0

func AddOrderTypeFlag(cmd *cobra.Command)

func AddPaginationFlags added in v0.2.0

func AddPaginationFlags(cmd *cobra.Command, includeSortLimit bool)

func AddPortfolioIdFlag added in v0.2.0

func AddPortfolioIdFlag(cmd *cobra.Command)

func AddProductIdFlag added in v0.2.0

func AddProductIdFlag(cmd *cobra.Command)

func AddProductIdsFlag added in v0.2.0

func AddProductIdsFlag(cmd *cobra.Command)

func AddQuoteValueFlag added in v0.2.1

func AddQuoteValueFlag(cmd *cobra.Command)

func AddSortDirectionFlag added in v0.2.0

func AddSortDirectionFlag(cmd *cobra.Command)

func AddStartEndFlags added in v0.2.0

func AddStartEndFlags(cmd *cobra.Command)

func AddWalletIdFlag added in v0.2.1

func AddWalletIdFlag(cmd *cobra.Command)

func CheckFormatFlag

func CheckFormatFlag(cmd *cobra.Command) (bool, error)

func FormatResponseAsJson

func FormatResponseAsJson(cmd *cobra.Command, response interface{}) (string, error)

func GetClientFromEnv

func GetClientFromEnv() (client.RestClient, error)

func GetContextWithTimeout

func GetContextWithTimeout() (context.Context, context.CancelFunc)

func GetEntityId

func GetEntityId(cmd *cobra.Command, client client.RestClient) (string, error)

func GetFlagBoolValue

func GetFlagBoolValue(cmd *cobra.Command, flagName string) bool

func GetFlagStringValue

func GetFlagStringValue(cmd *cobra.Command, flagName string) string

func GetPaginationParams

func GetPaginationParams(cmd *cobra.Command) (*model.PaginationParams, error)

func GetPortfolioId

func GetPortfolioId(cmd *cobra.Command, client client.RestClient) (string, error)

func GetStartEndFlagsAsTime added in v0.2.0

func GetStartEndFlagsAsTime(cmd *cobra.Command) (time.Time, time.Time, error)

func HandleListCmd added in v0.2.0

func HandleListCmd(cmd *cobra.Command, callback ListCmdCallback) error

func NewUuid

func NewUuid() uuid.UUID

func NewUuidStr

func NewUuidStr() string

func ParseDateRange

func ParseDateRange(startStr, endStr string) (time.Time, time.Time, error)

func PrintJsonDocs added in v0.2.0

func PrintJsonDocs[T any](cmd *cobra.Command, items []T) error

func ValidateOrderTypeAndLimitPrice

func ValidateOrderTypeAndLimitPrice(cmd *cobra.Command) error

func ValidateQuantities

func ValidateQuantities(cmd *cobra.Command) error

func ValidateSide

func ValidateSide(cmd *cobra.Command) error

func ValidateTimeInForce

func ValidateTimeInForce(cmd *cobra.Command) error

func ValidateUUID

func ValidateUUID(uuid string) error

func ValidateUUIDFlag

func ValidateUUIDFlag(cmd *cobra.Command, flagName string) error

Types

type ListCmdCallback added in v0.2.0

type ListCmdCallback func(paginationParams *model.PaginationParams) (*model.Pagination, error)

Jump to

Keyboard shortcuts

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