Documentation ¶
Index ¶
- Constants
- func AdjustOrderSize(amount, baseMin, baseMax, baseIncrement decimal.Decimal) decimal.Decimal
- func CalculateOrderSize(product *Product, amount decimal.Decimal, holds decimal.Decimal) (orderSize decimal.Decimal, err error)
- func GenerateUniqueId(params ...string) string
- func GetHttpTransport() *http.Transport
- func PrimeGet(ctx context.Context, url string, request, response interface{}) error
- func PrimePost(ctx context.Context, url string, request, response interface{}) error
- func SetCredentials(c *Credentials)
- func SetHttpTransport(tr *http.Transport) *http.Transport
- type AssetBalances
- type BalanceWithHolds
- type CreateConversionRequest
- type CreateConversionResponse
- type CreateOrderPreviewResponse
- type CreateOrderRequest
- type CreateOrderResponse
- type Credentials
- type DescribeBalancesRequest
- type DescribeBalancesResponse
- type DescribeProductsRequest
- type DescribeProductsResponse
- type DescribeWalletsRequest
- type DescribeWalletsResponse
- type ErrorMessage
- type IteratorParams
- type Pagination
- type PortfolioCommission
- type Product
- func (p Product) BaseIncrementNum() (amount decimal.Decimal, err error)
- func (p Product) BaseMaxSizeNum() (amount decimal.Decimal, err error)
- func (p Product) BaseMinSizeNum() (amount decimal.Decimal, err error)
- func (p Product) QuoteIncrementNum() (amount decimal.Decimal, err error)
- func (p Product) QuoteMaxSizeNum() (amount decimal.Decimal, err error)
- func (p Product) QuoteMinSizeNum() (amount decimal.Decimal, err error)
- type Wallet
Constants ¶
View Source
const ( WalletTypeVault = "VAULT" WalletTypeTrading = "TRADING" WalletTypeOther = "WALLET_TYPE_OTHER" BalanceTypeTrading = "TRADING_BALANCES" BalanceTypeVault = "VAULT_BALANCES" BalanceTypeTotal = "TOTAL_BALANCES" OrderSideBuy = "BUY" OrderSideSell = "SELL" OrderTypeMarket = "MARKET" OrderTypeLimit = "LIMIT" OrderTypeTwap = "TWAP" OrderTypeBlock = "BLOCK" TimeInForceGoodUntilTime = "GOOD_UNTIL_DATE_TIME" TimeInForceGoodUntilCancelled = "GOOD_UNTIL_CANCELLED" TimeInForceImmediateOrCancel = "IMMEDIATE_OR_CANCEL" )
Variables ¶
This section is empty.
Functions ¶
func AdjustOrderSize ¶
func CalculateOrderSize ¶
func GenerateUniqueId ¶
func GetHttpTransport ¶
func SetCredentials ¶
func SetCredentials(c *Credentials)
Types ¶
type AssetBalances ¶
type AssetBalances struct { Symbol string `json:"symbol"` Amount string `json:"amount"` Holds string `json:"holds"` BondedAmount string `json:"bonded_amount"` ReservedAmount string `json:"reserved_amount"` UnbondingAmount string `json:"unbonding_amount"` UnvestedAmount string `json:"unvested_amount"` PendingRewardsAmount string `json:"pending_rewards_amount"` PastRewardsAmount string `json:"past_rewards_amount"` BondableAmount string `json:"bondable_amount"` WithdrawableAmount string `json:"withdrawable_amount"` }
func (AssetBalances) AmountNum ¶
func (b AssetBalances) AmountNum() (amount decimal.Decimal, err error)
func (AssetBalances) HoldsNum ¶
func (b AssetBalances) HoldsNum() (holds decimal.Decimal, err error)
func (AssetBalances) IsFiat ¶
func (b AssetBalances) IsFiat() (f bool)
type BalanceWithHolds ¶
type CreateConversionRequest ¶
type CreateConversionRequest struct { PortfolioId string `json:"portfolio_id"` SourceWalletId string `json:"wallet_id"` SourceSymbol string `json:"source_symbol"` DestinationWalletId string `json:"destination"` DestinationSymbol string `json:"destination_symbol"` IdempotencyId string `json:"idempotency_key"` Amount string `json:"amount"` }
type CreateConversionResponse ¶
type CreateConversionResponse struct { ActivityId string `json:"activity_id"` SourceSymbol string `json:"source_symbol"` DestinationSymbol string `json:"destination_symbol"` Amount string `json:"amount"` DestinationWalletId string `json:"destination"` SourceWalletId string `json:"source"` Request *CreateConversionRequest `json:"request"` }
func CreateConversion ¶
func CreateConversion( ctx context.Context, request *CreateConversionRequest, ) (*CreateConversionResponse, error)
type CreateOrderPreviewResponse ¶
type CreateOrderPreviewResponse struct { PortfolioId string `json:"portfolio_id"` Side string `json:"side"` ClientOrderId string `json:"client_order_id"` ProductId string `json:"product_id"` Type string `json:"type"` BaseQuantity string `json:"base_quantity"` QuoteValue string `json:"quote_value,omitempty"` LimitPrice string `json:"limit_price,omitempty"` StartTime string `json:"start_time,omitempty"` ExpiryTime string `json:"expiry_time,omitempty"` TimeInForce string `json:"time_in_force,omitempty"` StpId string `json:"stp_id,omitempty"` DisplayQuoteSize string `json:"display_quote_size,omitempty"` DisplayBaseSize string `json:"display_base_size,omitempty"` IsRaiseExact string `json:"is_raise_exact,omitempty"` Commission string `json:"commission"` Slippage string `json:"slippage"` BestBid string `json:"best_bid"` BestAsk string `json:"best_ask"` AvgFillPrice string `json:"average_filled_price"` OrderTotal string `json:"order_total"` Request *CreateOrderRequest `json:"request"` }
func CreateOrderPreview ¶
func CreateOrderPreview( ctx context.Context, request *CreateOrderRequest, ) (*CreateOrderPreviewResponse, error)
type CreateOrderRequest ¶
type CreateOrderRequest struct { PortfolioId string `json:"portfolio_id"` Side string `json:"side"` ClientOrderId string `json:"client_order_id"` ProductId string `json:"product_id"` Type string `json:"type"` BaseQuantity string `json:"base_quantity"` QuoteValue string `json:"quote_value,omitempty"` LimitPrice string `json:"limit_price,omitempty"` StartTime string `json:"start_time,omitempty"` ExpiryTime string `json:"expiry_time,omitempty"` TimeInForce string `json:"time_in_force,omitempty"` StpId string `json:"stp_id,omitempty"` DisplayQuoteSize string `json:"display_quote_size,omitempty"` DisplayBaseSize string `json:"display_base_size,omitempty"` IsRaiseExact string `json:"is_raise_exact,omitempty"` }
type CreateOrderResponse ¶
type CreateOrderResponse struct { OrderId string `json:"order_id"` Request *CreateOrderRequest `json:"request"` }
func CreateOrder ¶
func CreateOrder(ctx context.Context, request *CreateOrderRequest) (*CreateOrderResponse, error)
type Credentials ¶
type Credentials struct { AccessKey string `json:"accessKey"` Passphrase string `json:"passphrase"` SigningKey string `json:"signingKey"` PortfolioId string `json:"portfolioId"` SvcAccountId string `json:"svcAccountId"` }
func GetCredentials ¶
func GetCredentials() *Credentials
func InitCredentials ¶
func InitCredentials() (*Credentials, error)
type DescribeBalancesRequest ¶
type DescribeBalancesResponse ¶
type DescribeBalancesResponse struct { Balances []*AssetBalances `json:"balances"` Type string `json:"type"` TradingBalances *BalanceWithHolds `json:"trading_balances"` VaultBalances *BalanceWithHolds `json:"vault_balances"` Request *DescribeBalancesRequest `json:"request"` }
func DescribeBalances ¶
func DescribeBalances( ctx context.Context, request *DescribeBalancesRequest, ) (*DescribeBalancesResponse, error)
type DescribeProductsRequest ¶
type DescribeProductsRequest struct { PortfolioId string `json:"portfolioId"` IteratorParams *IteratorParams `json:"iteratorParams"` }
type DescribeProductsResponse ¶
type DescribeProductsResponse struct { Products []*Product `json:"products"` Pagination *Pagination `json:"pagination"` Request *DescribeProductsRequest `json:"request"` }
func DescribeProducts ¶
func DescribeProducts( ctx context.Context, request *DescribeProductsRequest, ) (*DescribeProductsResponse, error)
func (DescribeProductsResponse) HasNext ¶
func (r DescribeProductsResponse) HasNext() bool
type DescribeWalletsRequest ¶
type DescribeWalletsRequest struct { PortfolioId string `json:"string"` Type string `json:"type"` Symbols []string `json:"symbols"` IteratorParams *IteratorParams `json:"iteratorParams"` }
type DescribeWalletsResponse ¶
type DescribeWalletsResponse struct { Wallets []*Wallet `json:"wallets"` Request *DescribeWalletsRequest `json:"request"` Pagination *Pagination `json:"pagination"` }
func DescribeWallets ¶
func DescribeWallets( ctx context.Context, request *DescribeWalletsRequest, ) (*DescribeWalletsResponse, error)
func (DescribeWalletsResponse) HasNext ¶
func (r DescribeWalletsResponse) HasNext() bool
type ErrorMessage ¶
type ErrorMessage struct {
Value string `json:"message"`
}
type IteratorParams ¶
type Pagination ¶
type PortfolioCommission ¶
type Product ¶
type Product struct { Id string `json:"id"` BaseIncrement string `json:"base_increment"` QuoteIncrement string `json:"quote_increment"` BaseMinSize string `json:"base_min_size"` BaseMaxSize string `json:"base_max_size"` QuoteMinSize string `json:"quote_min_size"` QuoteMaxSize string `json:"quote_max_size"` Permissions []string `json:"permissions"` }
func (Product) BaseIncrementNum ¶
func (Product) BaseMaxSizeNum ¶
func (Product) BaseMinSizeNum ¶
func (Product) QuoteIncrementNum ¶
func (Product) QuoteMaxSizeNum ¶
Click to show internal directories.
Click to hide internal directories.