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 TimeToStr(t time.Time) string
- type AccountMetadata
- type Activity
- type AddressBookEntry
- type AddressBookEntryAddedBy
- type Allocation
- type AllocationDestination
- type AllocationLeg
- type Asset
- type Balance
- type BalanceWithHolds
- type BlockchainAddress
- type CancelOrderRequest
- type CancelOrderResponse
- type Client
- func (c *Client) BaseUrl(u string) *Client
- func (c Client) CancelOrder(ctx context.Context, request *CancelOrderRequest) (*CancelOrderResponse, error)
- func (c Client) CreateAddressBookEntry(ctx context.Context, request *CreateAddressBookEntryRequest) (*CreateAddressBookEntryResponse, error)
- func (c Client) CreateConversion(ctx context.Context, request *CreateConversionRequest) (*CreateConversionResponse, error)
- func (c Client) CreateOrder(ctx context.Context, request *CreateOrderRequest) (*CreateOrderResponse, error)
- func (c Client) CreateOrderPreview(ctx context.Context, request *CreateOrderRequest) (*CreateOrderPreviewResponse, error)
- func (c Client) CreatePortfolioAllocations(ctx context.Context, request *CreatePortfolioAllocationsRequest) (*CreatePortfolioAllocationsResponse, error)
- func (c Client) CreateWallet(ctx context.Context, request *CreateWalletRequest) (*CreateWalletResponse, error)
- func (c Client) CreateWalletTransfer(ctx context.Context, request *CreateWalletTransferRequest) (*CreateWalletTransferResponse, error)
- func (c Client) CreateWalletWithdrawal(ctx context.Context, request *CreateWalletWithdrawalRequest) (*CreateWalletWithdrawalResponse, error)
- func (c Client) GetActivity(ctx context.Context, request *GetActivityRequest) (*GetActivityResponse, error)
- func (c Client) GetAddressBook(ctx context.Context, request *GetAddressBookRequest) (*GetAddressBookResponse, error)
- func (c Client) GetEntityPaymentMethod(ctx context.Context, request *GetEntityPaymentMethodRequest) (*GetEntityPaymentMethodResponse, error)
- func (c Client) GetOrder(ctx context.Context, request *GetOrderRequest) (*GetOrderResponse, error)
- func (c Client) GetPortfolio(ctx context.Context, request *GetPortfolioRequest) (*GetPortfolioResponse, error)
- func (c Client) GetPortfolioAllocation(ctx context.Context, request *GetPortfolioAllocationRequest) (*GetPortfolioAllocationResponse, error)
- func (c Client) GetPortfolioCommission(ctx context.Context, request *GetPortfolioCommissionRequest) (*GetPortfolioCommissionResponse, error)
- func (c Client) GetPortfolioCredit(ctx context.Context, request *GetPortfolioCreditRequest) (*GetPortfolioCreditResponse, error)
- func (c Client) GetTransaction(ctx context.Context, request *GetTransactionRequest) (*GetTransactionResponse, error)
- func (c Client) GetWallet(ctx context.Context, request *GetWalletRequest) (*GetWalletResponse, error)
- func (c Client) GetWalletBalance(ctx context.Context, request *GetWalletBalanceRequest) (*GetWalletBalanceResponse, error)
- func (c Client) GetWalletDepositInstructions(ctx context.Context, request *GetWalletDepositInstructionsRequest) (*GetWalletDepositInstructionsResponse, error)
- func (c Client) ListActivities(ctx context.Context, request *ListActivitiesRequest) (*ListActivitiesResponse, error)
- func (c Client) ListAssets(ctx context.Context, request *ListAssetsRequest) (*ListAssetsResponse, error)
- func (c Client) ListEntityUsers(ctx context.Context, request *ListEntityUsersRequest) (*ListEntityUsersResponse, error)
- func (c Client) ListInvoices(ctx context.Context, request *ListInvoicesRequest) (*ListInvoicesResponse, error)
- func (c Client) ListOpenOrders(ctx context.Context, request *ListOpenOrdersRequest) (*ListOpenOrdersResponse, error)
- func (c Client) ListOrderFills(ctx context.Context, request *ListOrderFillsRequest) (*ListOrderFillsResponse, error)
- func (c Client) ListOrders(ctx context.Context, request *ListOrdersRequest) (*ListOrdersResponse, error)
- func (c Client) ListPortfolioAllocations(ctx context.Context, request *ListPortfolioAllocationsRequest) (*ListPortfolioAllocationsResponse, error)
- func (c Client) ListPortfolioBalances(ctx context.Context, request *ListPortfolioBalancesRequest) (*ListPortfolioBalancesResponse, error)
- func (c Client) ListPortfolioTransactions(ctx context.Context, request *ListPortfolioTransactionsRequest) (*ListPortfolioTransactionsResponse, error)
- func (c Client) ListPortfolioUsers(ctx context.Context, request *ListPortfolioUsersRequest) (*ListPortfolioUsersResponse, error)
- func (c Client) ListPortfolios(ctx context.Context, request *ListPortfoliosRequest) (*ListPortfoliosResponse, error)
- func (c Client) ListProducts(ctx context.Context, request *ListProductsRequest) (*ListProductsResponse, error)
- func (c Client) ListWalletBalances(ctx context.Context, request *ListWalletBalancesRequest) (*ListWalletBalancesResponse, error)
- func (c Client) ListWalletTransactions(ctx context.Context, request *ListWalletTransactionsRequest) (*ListWalletTransactionsResponse, error)
- func (c Client) ListWallets(ctx context.Context, request *ListWalletsRequest) (*ListWalletsResponse, error)
- type Commission
- type Consensus
- type CreateAddressBookEntryRequest
- type CreateAddressBookEntryResponse
- type CreateConversionRequest
- type CreateConversionResponse
- type CreateOrderPreviewResponse
- type CreateOrderRequest
- type CreateOrderResponse
- type CreatePortfolioAllocationsRequest
- type CreatePortfolioAllocationsResponse
- type CreateWalletRequest
- type CreateWalletResponse
- type CreateWalletTransferRequest
- type CreateWalletTransferResponse
- type CreateWalletWithdrawalPaymentMethod
- type CreateWalletWithdrawalRequest
- type CreateWalletWithdrawalResponse
- type Credentials
- type CryptoDepositInstructions
- type ErrorMessage
- type FiatDepositInstructions
- type GetActivityRequest
- type GetActivityResponse
- type GetAddressBookRequest
- type GetAddressBookResponse
- type GetEntityPaymentMethodRequest
- type GetEntityPaymentMethodResponse
- type GetOrderRequest
- type GetOrderResponse
- type GetPortfolioAllocationRequest
- type GetPortfolioAllocationResponse
- type GetPortfolioCommissionRequest
- type GetPortfolioCommissionResponse
- type GetPortfolioCreditRequest
- type GetPortfolioCreditResponse
- type GetPortfolioRequest
- type GetPortfolioResponse
- type GetTransactionRequest
- type GetTransactionResponse
- type GetWalletBalanceRequest
- type GetWalletBalanceResponse
- type GetWalletDepositInstructionsRequest
- type GetWalletDepositInstructionsResponse
- type GetWalletRequest
- type GetWalletResponse
- type Invoice
- type InvoiceItem
- type ListActivitiesRequest
- type ListActivitiesResponse
- type ListAssetsRequest
- type ListAssetsResponse
- type ListEntityUsersRequest
- type ListEntityUsersResponse
- type ListInvoicesRequest
- type ListInvoicesResponse
- type ListOpenOrdersRequest
- type ListOpenOrdersResponse
- type ListOrderFillsRequest
- type ListOrderFillsResponse
- type ListOrdersRequest
- type ListOrdersResponse
- type ListPortfolioAllocationsRequest
- type ListPortfolioAllocationsResponse
- type ListPortfolioBalancesRequest
- type ListPortfolioBalancesResponse
- type ListPortfolioTransactionsRequest
- type ListPortfolioTransactionsResponse
- type ListPortfolioUsersRequest
- type ListPortfolioUsersResponse
- type ListPortfoliosRequest
- type ListPortfoliosResponse
- type ListProductsRequest
- type ListProductsResponse
- type ListWalletBalancesRequest
- type ListWalletBalancesResponse
- type ListWalletTransactionsRequest
- type ListWalletTransactionsResponse
- type ListWalletsRequest
- type ListWalletsResponse
- type Order
- type OrderFill
- type OrdersMetadata
- type Pagination
- type PaginationParams
- type Portfolio
- type PostTradeCredit
- type PostTradeCreditAmountDue
- 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 Transaction
- type TransactionsMetadata
- type Transfer
- type User
- type UserAction
- type Wallet
Constants ¶
View Source
const ( WalletTypeVault = "VAULT" WalletTypeTrading = "TRADING" WalletTypeOther = "WALLET_TYPE_OTHER" WalletDepositTypeWire = "WIRE" WalletDepositTypeSwift = "SWIFT" WalletDepositTypeCrypto = "CRYPTO" 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 ¶
Types ¶
type AccountMetadata ¶
type AccountMetadata struct {
Consensus *Consensus `json:"consensus"`
}
type Activity ¶
type Activity struct { Id string `json:"id"` ReferenceId string `json:"reference_id"` Category string `json:"category"` PrimaryType string `json:"type"` SecondaryType string `json:"secondary_type"` Status string `json:"status"` CreatedBy string `json:"created_by"` Title string `json:"title"` Description string `json:"description"` UserActions []*UserAction `json:"user_actions"` AccountMetadata *AccountMetadata `json:"account_metadata"` OrdersMetadata *OrdersMetadata `json:"orders_metadata"` Symbols []string `json:"symbols"` Created string `json:"created_at"` Updated string `json:"updated_at"` }
type AddressBookEntry ¶
type AddressBookEntry struct { Id string `json:"id"` Symbol string `json:"currency_symbol"` Name string `json:"name"` Address string `json:"address"` AccountIdentifier string `json:"account_identifier"` AccountIdentifierName string `json:"account_identifier_name"` State string `json:"state"` ExplorerLink string `json:"explorer_link"` LastUsed time.Time `json:"last_used_at"` Added time.Time `json:"added_at"` AddedBy *AddressBookEntryAddedBy `json:"added_by"` }
type AddressBookEntryAddedBy ¶
type Allocation ¶
type Allocation struct { RootId string `json:"root_id"` ReversalId string `json:"reversal_id"` Completed string `json:"allocation_completed_at"` UserId string `json:"user_id"` ProductId string `json:"product_id"` AvgPrice string `json:"avg_price"` BaseQuantity string `json:"base_quantity"` QuoteValue string `json:"quote_value"` FeesAllocated string `json:"fees_allocated"` Status string `json:"status"` Source string `json:"source"` OrderIds []string `json:"order_ids"` Destinations []*AllocationDestination `json:"destinations"` }
type AllocationDestination ¶
type AllocationLeg ¶
type Balance ¶
type Balance 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"` }
type BalanceWithHolds ¶
type BlockchainAddress ¶
type CancelOrderRequest ¶
type CancelOrderResponse ¶
type CancelOrderResponse struct { OrderId string `json:"id"` Request *CancelOrderRequest `json:"request"` }
type Client ¶
type Client struct { HttpClient http.Client Credentials *Credentials HttpBaseUrl string }
func (Client) CancelOrder ¶
func (c Client) CancelOrder(ctx context.Context, request *CancelOrderRequest) (*CancelOrderResponse, error)
func (Client) CreateAddressBookEntry ¶
func (c Client) CreateAddressBookEntry( ctx context.Context, request *CreateAddressBookEntryRequest, ) (*CreateAddressBookEntryResponse, error)
func (Client) CreateConversion ¶
func (c Client) CreateConversion( ctx context.Context, request *CreateConversionRequest, ) (*CreateConversionResponse, error)
func (Client) CreateOrder ¶
func (c Client) CreateOrder(ctx context.Context, request *CreateOrderRequest) (*CreateOrderResponse, error)
func (Client) CreateOrderPreview ¶
func (c Client) CreateOrderPreview( ctx context.Context, request *CreateOrderRequest, ) (*CreateOrderPreviewResponse, error)
func (Client) CreatePortfolioAllocations ¶
func (c Client) CreatePortfolioAllocations( ctx context.Context, request *CreatePortfolioAllocationsRequest, ) (*CreatePortfolioAllocationsResponse, error)
func (Client) CreateWallet ¶
func (c Client) CreateWallet(ctx context.Context, request *CreateWalletRequest) (*CreateWalletResponse, error)
func (Client) CreateWalletTransfer ¶
func (c Client) CreateWalletTransfer( ctx context.Context, request *CreateWalletTransferRequest, ) (*CreateWalletTransferResponse, error)
func (Client) CreateWalletWithdrawal ¶
func (c Client) CreateWalletWithdrawal( ctx context.Context, request *CreateWalletWithdrawalRequest, ) (*CreateWalletWithdrawalResponse, error)
func (Client) GetActivity ¶
func (c Client) GetActivity( ctx context.Context, request *GetActivityRequest, ) (*GetActivityResponse, error)
func (Client) GetAddressBook ¶
func (c Client) GetAddressBook( ctx context.Context, request *GetAddressBookRequest, ) (*GetAddressBookResponse, error)
func (Client) GetEntityPaymentMethod ¶
func (c Client) GetEntityPaymentMethod( ctx context.Context, request *GetEntityPaymentMethodRequest, ) (*GetEntityPaymentMethodResponse, error)
func (Client) GetOrder ¶
func (c Client) GetOrder( ctx context.Context, request *GetOrderRequest, ) (*GetOrderResponse, error)
func (Client) GetPortfolio ¶
func (c Client) GetPortfolio( ctx context.Context, request *GetPortfolioRequest, ) (*GetPortfolioResponse, error)
func (Client) GetPortfolioAllocation ¶
func (c Client) GetPortfolioAllocation( ctx context.Context, request *GetPortfolioAllocationRequest, ) (*GetPortfolioAllocationResponse, error)
func (Client) GetPortfolioCommission ¶
func (c Client) GetPortfolioCommission( ctx context.Context, request *GetPortfolioCommissionRequest, ) (*GetPortfolioCommissionResponse, error)
func (Client) GetPortfolioCredit ¶
func (c Client) GetPortfolioCredit( ctx context.Context, request *GetPortfolioCreditRequest, ) (*GetPortfolioCreditResponse, error)
func (Client) GetTransaction ¶
func (c Client) GetTransaction( ctx context.Context, request *GetTransactionRequest, ) (*GetTransactionResponse, error)
func (Client) GetWallet ¶
func (c Client) GetWallet( ctx context.Context, request *GetWalletRequest, ) (*GetWalletResponse, error)
func (Client) GetWalletBalance ¶
func (c Client) GetWalletBalance( ctx context.Context, request *GetWalletBalanceRequest, ) (*GetWalletBalanceResponse, error)
func (Client) GetWalletDepositInstructions ¶
func (c Client) GetWalletDepositInstructions( ctx context.Context, request *GetWalletDepositInstructionsRequest, ) (*GetWalletDepositInstructionsResponse, error)
func (Client) ListActivities ¶
func (c Client) ListActivities( ctx context.Context, request *ListActivitiesRequest, ) (*ListActivitiesResponse, error)
func (Client) ListAssets ¶
func (c Client) ListAssets( ctx context.Context, request *ListAssetsRequest, ) (*ListAssetsResponse, error)
func (Client) ListEntityUsers ¶
func (c Client) ListEntityUsers( ctx context.Context, request *ListEntityUsersRequest, ) (*ListEntityUsersResponse, error)
func (Client) ListInvoices ¶
func (c Client) ListInvoices( ctx context.Context, request *ListInvoicesRequest, ) (*ListInvoicesResponse, error)
func (Client) ListOpenOrders ¶
func (c Client) ListOpenOrders( ctx context.Context, request *ListOpenOrdersRequest, ) (*ListOpenOrdersResponse, error)
ListOpenOrders enables searching for open orders by product id. This API endpoint is currently being adjusted by Coinbase. This function will change once the Prime endpoint design is finalized. This will not return more than 1k open orders and pagination is not supported. https://docs.cloud.coinbase.com/prime/reference/primerestapi_getopenorders
func (Client) ListOrderFills ¶
func (c Client) ListOrderFills( ctx context.Context, request *ListOrderFillsRequest, ) (*ListOrderFillsResponse, error)
func (Client) ListOrders ¶
func (c Client) ListOrders( ctx context.Context, request *ListOrdersRequest, ) (*ListOrdersResponse, error)
ListOrders returns orders based on query params. Start time is required. This API endpoint cannot list open orders, so do not add an OPEN status to the status param. https://docs.cloud.coinbase.com/prime/reference/primerestapi_getorders
func (Client) ListPortfolioAllocations ¶
func (c Client) ListPortfolioAllocations( ctx context.Context, request *ListPortfolioAllocationsRequest, ) (*ListPortfolioAllocationsResponse, error)
func (Client) ListPortfolioBalances ¶
func (c Client) ListPortfolioBalances( ctx context.Context, request *ListPortfolioBalancesRequest, ) (*ListPortfolioBalancesResponse, error)
func (Client) ListPortfolioTransactions ¶
func (c Client) ListPortfolioTransactions( ctx context.Context, request *ListPortfolioTransactionsRequest, ) (*ListPortfolioTransactionsResponse, error)
func (Client) ListPortfolioUsers ¶
func (c Client) ListPortfolioUsers( ctx context.Context, request *ListPortfolioUsersRequest, ) (*ListPortfolioUsersResponse, error)
func (Client) ListPortfolios ¶
func (c Client) ListPortfolios( ctx context.Context, request *ListPortfoliosRequest, ) (*ListPortfoliosResponse, error)
func (Client) ListProducts ¶
func (c Client) ListProducts( ctx context.Context, request *ListProductsRequest, ) (*ListProductsResponse, error)
func (Client) ListWalletBalances ¶
func (c Client) ListWalletBalances( ctx context.Context, request *ListWalletBalancesRequest, ) (*ListWalletBalancesResponse, error)
func (Client) ListWalletTransactions ¶
func (c Client) ListWalletTransactions( ctx context.Context, request *ListWalletTransactionsRequest, ) (*ListWalletTransactionsResponse, error)
func (Client) ListWallets ¶
func (c Client) ListWallets( ctx context.Context, request *ListWalletsRequest, ) (*ListWalletsResponse, error)
type Commission ¶
type CreateAddressBookEntryResponse ¶
type CreateAddressBookEntryResponse struct { ActivityId string `json:"activity_id"` Type string `json:"activity_type"` RemainingApprovals int32 `json:"num_approvals_remaining"` Request *CreateAddressBookEntryRequest `json:"request"` }
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"` IdempotencyKey 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"` }
type CreateOrderPreviewResponse ¶
type CreateOrderPreviewResponse struct { Order *Order `json:"order"` Request *CreateOrderRequest `json:"request"` }
type CreateOrderRequest ¶
type CreateOrderRequest struct {
Order *Order `json:"order"`
}
type CreateOrderResponse ¶
type CreateOrderResponse struct { OrderId string `json:"order_id"` Request *CreateOrderRequest `json:"request"` }
type CreatePortfolioAllocationsRequest ¶
type CreatePortfolioAllocationsRequest struct { AllocationId string `json:"allocation_id"` SourcePortfolioId string `json:"source_portfolio_id"` ProductId string `json:"product_id"` OrderIds []string `json:"order_ids"` AllocationLegs []*AllocationLeg `json:"allocation_legs"` SizeType string `json:"size_type"` RemainderDestinationPortfolioId string `json:"remainder_destination_portfolio"` }
type CreatePortfolioAllocationsResponse ¶
type CreatePortfolioAllocationsResponse struct { Success bool `json:"success"` AllocationId string `json:"allocation_id"` FailureReason string `json:"failure_reason"` Request *CreatePortfolioAllocationsRequest `json:"request"` }
type CreateWalletRequest ¶
type CreateWalletResponse ¶
type CreateWalletResponse struct { ActivityId string `json:"activity_id"` Name string `json:"name"` Symbol string `json:"symbol"` Type string `json:"wallet_type"` Request *CreateWalletRequest `json:"request"` }
type CreateWalletTransferResponse ¶
type CreateWalletTransferResponse struct { ActivityId string `json:"activity_id"` ApprovalUrl string `json:"approval_url"` Symbol string `json:"symbol"` Amount string `json:"amount"` Fee string `json:"fee"` DestinationAddress string `json:"destination_address"` DestinationType string `json:"destination_type"` SourceAddress string `json:"source_address"` SourceType string `json:"source_type"` TransactionId string `json:"transaction_id"` Request *CreateWalletTransferRequest `json:"request"` }
type CreateWalletWithdrawalPaymentMethod ¶
type CreateWalletWithdrawalPaymentMethod struct {
Id string `json:"payment_method_id"`
}
type CreateWalletWithdrawalRequest ¶
type CreateWalletWithdrawalRequest struct { PortfolioId string `json:"portfolio_id"` SourceWalletId string `json:"wallet_id"` Amount string `json:"amount"` DestinationType string `json:"destination_type"` IdempotencyKey string `json:"idempotency_key"` Symbol string `json:"currency_symbol"` PaymentMethod *CreateWalletWithdrawalPaymentMethod `json:"payment_method"` BlockchainAddress *BlockchainAddress `json:"blockchain_address"` }
type CreateWalletWithdrawalResponse ¶
type CreateWalletWithdrawalResponse struct { ActivityId string `json:"activity_id"` ApprovalUrl string `json:"approval_url"` Symbol string `json:"symbol"` Amount string `json:"amount"` Fee string `json:"fee"` DestinationType string `json:"destination_type"` SourceType string `json:"source_type"` Destination *BlockchainAddress `json:"blockchain_destination"` Source *BlockchainAddress `json:"blockchain_source"` TransactionId string `json:"transaction_id"` Request *CreateWalletWithdrawalRequest `json:"request"` }
type Credentials ¶
type Credentials struct { AccessKey string `json:"accessKey"` Passphrase string `json:"passphrase"` SigningKey string `json:"signingKey"` PortfolioId string `json:"portfolioId"` EntityId string `json:"entityId"` // The Service Account ID is the API key's user id equivalent when looking at activities SvcAccountId string `json:"svcAccountId"` }
func ReadEnvCredentials ¶
func ReadEnvCredentials(variableName string) (*Credentials, error)
func UnmarshalCredentials ¶
func UnmarshalCredentials(b []byte) (*Credentials, error)
type ErrorMessage ¶
type ErrorMessage struct {
Value string `json:"message"`
}
type FiatDepositInstructions ¶
type GetActivityRequest ¶
type GetActivityResponse ¶
type GetActivityResponse struct { Activity *Activity `json:"activity"` Request *GetActivityRequest }
type GetAddressBookRequest ¶
type GetAddressBookRequest struct { PortfolioId string `json:"portfolio_id"` Symbol string `json:"currency_symbol"` Search string `json:"search"` Pagination *PaginationParams `json:"pagination_params"` }
type GetAddressBookResponse ¶
type GetAddressBookResponse struct { Addresses []*AddressBookEntry `json:"addresses"` Request *GetAddressBookRequest `json:"request"` Pagination *Pagination `json:"pagination"` }
type GetEntityPaymentMethodResponse ¶
type GetEntityPaymentMethodResponse struct { Id string `json:"id"` Symbol string `json:"symbol"` PaymentMethodType string `json:"payment_method_type"` Name string `json:"name"` AccountNumber string `json:"account_number"` BankCode string `json:"bank_code"` Request *GetEntityPaymentMethodRequest `json:"request"` }
type GetOrderRequest ¶
type GetOrderResponse ¶
type GetOrderResponse struct { Order *Order `json:"order"` Request *GetOrderRequest `json:"request"` }
type GetPortfolioAllocationResponse ¶
type GetPortfolioAllocationResponse struct { Allocation *Allocation `json:"allocation"` Request *GetPortfolioAllocationRequest `json:"request"` }
type GetPortfolioCommissionRequest ¶
type GetPortfolioCommissionRequest struct {
PortfolioId string `json:"portfolio_id"`
}
type GetPortfolioCommissionResponse ¶
type GetPortfolioCommissionResponse struct { Commission *Commission `json:"commission"` Request *GetPortfolioCommissionRequest `json:"request"` }
type GetPortfolioCreditRequest ¶
type GetPortfolioCreditRequest struct {
Id string `json:"portfolio_id"`
}
type GetPortfolioCreditResponse ¶
type GetPortfolioCreditResponse struct { PostTradeCredit *PostTradeCredit `json:"post_trade_credit"` Request *GetPortfolioCreditRequest `json:"request"` }
type GetPortfolioRequest ¶
type GetPortfolioRequest struct {
PortfolioId string `json:"portfolio_id"`
}
type GetPortfolioResponse ¶
type GetPortfolioResponse struct { Portfolio *Portfolio `json:"portfolio"` Request *GetPortfolioRequest `json:"request"` }
type GetTransactionRequest ¶
type GetTransactionResponse ¶
type GetTransactionResponse struct { Transaction *Transaction `json:"transaction"` Request *GetTransactionRequest `json:"request"` }
type GetWalletBalanceRequest ¶
type GetWalletBalanceResponse ¶
type GetWalletBalanceResponse struct { Balance *Balance `json:"balance"` Request *GetWalletBalanceRequest }
type GetWalletDepositInstructionsResponse ¶
type GetWalletDepositInstructionsResponse struct { Crypto *CryptoDepositInstructions `json:"crypto_instructions"` Fiat *FiatDepositInstructions `json:"fiat_instructions"` Request *GetWalletDepositInstructionsRequest }
type GetWalletRequest ¶
type GetWalletResponse ¶
type GetWalletResponse struct { Wallet *Wallet `json:"wallet"` Request *GetWalletRequest }
type Invoice ¶
type Invoice struct { Id string `json:"id"` BillingYear int32 `json:"billing_year"` BillingMonth int32 `json:"billing_month"` DueDate string `json:"due_date"` InvoiceNumber string `json:"invoice_number"` State string `json:"state"` UsdAmountPaid float64 `json:"usd_amount_paid"` UsdAmountOwed float64 `json:"usd_amount_owed"` Items []*InvoiceItem `json:"invoice_items"` }
type InvoiceItem ¶
type InvoiceItem struct { Description string `json:"description"` CurrencySymbol string `json:"currency_symbol"` InvoiceType string `json:"invoice_type"` Type string `json:"invoice_type"` Rate float64 `json:"rate"` Quantity float64 `json:"quantity"` Price float64 `json:"price"` AverageAuc float64 `json:"average_auc"` Total float64 `json:"total"` }
type ListActivitiesRequest ¶
type ListActivitiesRequest struct { PortfolioId string `json:"portfolio_id"` Symbols []string `json:"symbols"` Categories []string `json:"categories"` Statuses []string `json:"statuses"` Start time.Time `json:"start_time"` End time.Time `json:"end_time"` Pagination *PaginationParams `json:"pagination_params"` }
type ListActivitiesResponse ¶
type ListActivitiesResponse struct { Activities []*Activity `json:"activities"` Request *ListActivitiesRequest `json:"request"` Pagination *Pagination `json:"pagination"` }
type ListAssetsRequest ¶
type ListAssetsRequest struct {
EntityId string `json:"entity_id"`
}
type ListAssetsResponse ¶
type ListAssetsResponse struct { Assets []*Asset `json:"assets"` Request *ListAssetsRequest `json:"request"` }
type ListEntityUsersRequest ¶
type ListEntityUsersRequest struct { EntityId string `json:"entity_id"` Pagination *PaginationParams `json:"pagination_params"` }
type ListEntityUsersResponse ¶
type ListEntityUsersResponse struct { Users []*User `json:"users"` Request *ListEntityUsersRequest `json:"request"` Pagination *Pagination `json:"pagination"` }
type ListInvoicesRequest ¶
type ListInvoicesRequest struct { EntityId string `json:"entity_id"` States []string `json:"states"` BillingYear int32 `json:"billing_year"` BillingMonth int32 `json:"billing_month"` Pagination *PaginationParams `json:"pagination_params"` }
type ListInvoicesResponse ¶
type ListInvoicesResponse struct { Invoices []*Invoice `json:"invoices"` Request *ListInvoicesRequest `json:"request"` Pagination *Pagination `json:"pagination"` }
type ListOpenOrdersRequest ¶
type ListOpenOrdersResponse ¶
type ListOpenOrdersResponse struct { Orders []*Order `json:"orders"` Request *ListOpenOrdersRequest `json:"request"` }
type ListOrderFillsRequest ¶
type ListOrderFillsRequest struct { PortfolioId string `json:"portfolio_id"` // required OrderId string `json:"order_id"` // required Pagination *PaginationParams `json:"pagination_params"` }
type ListOrderFillsResponse ¶
type ListOrderFillsResponse struct { Fills []*OrderFill `json:"fills"` Pagination *Pagination `json:"pagination"` Request *ListOrderFillsRequest `json:"request"` }
type ListOrdersRequest ¶
type ListOrdersRequest struct { PortfolioId string `json:"portfolio_id"` // required Statuses []string `json:"order_statuses"` ProductIds []string `json:"product_ids"` Type string `json:"order_type"` OtherSide string `json:"order_side"` Start time.Time `json:"start_date"` // required End time.Time `json:"end_date"` Pagination *PaginationParams `json:"pagination_params"` }
type ListOrdersResponse ¶
type ListOrdersResponse struct { Orders []*Order `json:"orders"` Pagination *Pagination `json:"pagination"` Request *ListOrdersRequest `json:"request"` }
type ListPortfolioAllocationsResponse ¶
type ListPortfolioAllocationsResponse struct { Request *ListPortfolioAllocationsRequest `json:"request"` Pagination *Pagination `json:"pagination"` }
type ListPortfolioBalancesResponse ¶
type ListPortfolioBalancesResponse struct { Balances []*Balance `json:"balances"` Type string `json:"type"` TradingWalletBalances *BalanceWithHolds `json:"trading_balances"` VaultWalletBalances *BalanceWithHolds `json:"vault_balances"` Request *ListPortfolioBalancesRequest `json:"request"` }
type ListPortfolioTransactionsResponse ¶
type ListPortfolioTransactionsResponse struct { Transactions []*Transaction `json:"transactions"` Pagination *Pagination `json:"pagination"` Request *ListPortfolioTransactionsRequest `json:"request"` }
type ListPortfolioUsersRequest ¶
type ListPortfolioUsersRequest struct { PortfolioId string `json:"portfolio_id"` Pagination *PaginationParams `json:"pagination_params"` }
type ListPortfolioUsersResponse ¶
type ListPortfolioUsersResponse struct { Users []*User `json:"users"` Request *ListPortfolioUsersRequest `json:"request"` Pagination *Pagination `json:"pagination"` }
type ListPortfoliosRequest ¶
type ListPortfoliosRequest struct{}
type ListPortfoliosResponse ¶
type ListPortfoliosResponse struct { Portfolios []*Portfolio `json:"portfolios"` Request *ListPortfoliosRequest `json:"request"` }
type ListProductsRequest ¶
type ListProductsRequest struct { PortfolioId string `json:"portfolio_id"` Pagination *PaginationParams `json:"pagination_params"` }
type ListProductsResponse ¶
type ListProductsResponse struct { Products []*Product `json:"products"` Pagination *Pagination `json:"pagination"` Request *ListProductsRequest `json:"request"` }
type ListWalletBalancesResponse ¶
type ListWalletBalancesResponse struct { Balances []*Balance `json:"balances"` Type string `json:"type"` TradingWalletBalances *BalanceWithHolds `json:"trading_balances"` VaultWalletBalances *BalanceWithHolds `json:"vault_balances"` Request *ListWalletBalancesRequest `json:"request"` }
type ListWalletTransactionsRequest ¶
type ListWalletTransactionsRequest struct { PortfolioId string `json:"portfolio_id"` WalletId string `json:"wallet_id"` Symbols string `json:"symbols"` Types []string `json:"types"` Start time.Time `json:"start_time"` End time.Time `json:"end_time"` Pagination *PaginationParams `json:"pagination_params"` }
type ListWalletTransactionsResponse ¶
type ListWalletTransactionsResponse struct { Transactions []*Transaction `json:"transactions"` Pagination *Pagination `json:"pagination"` Request *ListWalletTransactionsRequest `json:"request"` }
type ListWalletsRequest ¶
type ListWalletsRequest struct { PortfolioId string `json:"portfolio_id"` Type string `json:"type"` Symbols []string `json:"symbols"` Pagination *PaginationParams `json:"pagination_params"` }
type ListWalletsResponse ¶
type ListWalletsResponse struct { Wallets []*Wallet `json:"wallets"` Request *ListWalletsRequest `json:"request"` Pagination *Pagination `json:"pagination"` }
func (ListWalletsResponse) HasNext ¶
func (r ListWalletsResponse) HasNext() bool
type Order ¶
type Order struct { PortfolioId string `json:"portfolio_id"` Side string `json:"side"` // A client-generated order ID used for reference purposes (note: order will be rejected if this ID // is not unique among all currently active orders) ClientOrderId string `json:"client_order_id"` ProductId string `json:"product_id"` Type string `json:"type"` // Order size in base asset units (either `base_quantity` or `quote_value` is required) BaseQuantity string `json:"base_quantity"` // Order size in quote asset units, i.e. the amount the user wants to spend (when buying) or receive (when selling); // the quantity in base units will be determined based on the market liquidity and indicated `quote_value` (either // `base_quantity` or `quote_value` is required) QuoteValue string `json:"quote_value,omitempty"` LimitPrice string `json:"limit_price,omitempty"` // The start time of the order in UTC (TWAP only) StartTime string `json:"start_time,omitempty"` // The expiry time of the order in UTC (TWAP and limit GTD only) ExpiryTime string `json:"expiry_time,omitempty"` TimeInForce string `json:"time_in_force,omitempty"` // An optional self trade prevention id (in the form of a UUID). The value is only honored for certain // clients who are permitted to specify a custom self trade prevention id StpId string `json:"stp_id,omitempty"` // Optionally specify a display size. This is the maximum order size that will show up on venue order books. // Specifying a value here effectively makes a LIMIT order into an "iceberg" style order. // This property only applies to LIMIT orders and will be ignored for other order types. DisplayQuoteSize string `json:"display_quote_size,omitempty"` DisplayBaseSize string `json:"display_base_size,omitempty"` // If you pass is_raise_exact = TRUE, you must use quote_value = n where n is the amount you want, // so $2000 will then cost you 1 ETH + fee, requiring > 1 ETH IsRaiseExact string `json:"is_raise_exact,omitempty"` // Used for describe order and create order preview Id string `json:"id,omitempty"` UserId string `json:"user_id,omitempty"` Created string `json:"created_at,omitempty"` FilledQuantity string `json:"filled_quantity,omitempty"` FilledValue string `json:"filled_value,omitempty"` AverageFilledPrice string `json:"average_filled_price,omitempty"` Commission string `json:"commission,omitempty"` ExchangeFee string `json:"exchange_fee,omitempty"` Total string `json:"order_total,omitempty"` BestBid string `json:"best_bid,omitempty"` BestAsk string `json:"best_ask,omitempty"` Slippage string `json:"slippage,omitempty"` }
type OrderFill ¶
type OrderFill struct { Id string `json:"id"` Side string `json:"side"` ProductId string `json:"product_id"` FilledQuantity string `json:"filled_quantity"` FilledValue string `json:"filled_value"` Price string `json:"price"` Time time.Time `json:"time"` Commission string `json:"commission"` Venue string `json:"venue"` }
type OrdersMetadata ¶
type OrdersMetadata struct{}
An empty/unimplemented/placeholder object in Prime
type Pagination ¶
type PaginationParams ¶
type PostTradeCredit ¶
type PostTradeCredit struct { Id string `json:"portfolio_id"` Currency string `json:"currency"` Limit string `json:"limit"` Utilized string `json:"utilized"` Available string `json:"available"` Frozen bool `json:"frozen"` AmountsDue []*PostTradeCreditAmountDue `json:"amounts_due"` FrozenReason string `json:"frozen_reason"` Enabled bool `json:"enabled"` AdjustedCreditUtilized string `json:"adjusted_credit_utilized"` AdjustedEquity string `json:"adjusted_portfolio_equity"` }
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 ¶
type Transaction ¶
type Transaction struct { Id string `json:"id"` WalletId string `json:"wallet_id"` PortfolioId string `json:"portfolio_id"` Type string `json:"type"` Status string `json:"status"` Symbol string `json:"symbol"` Created time.Time `json:"created_at"` Completed time.Time `json:"completed_at"` Amount string `json:"amount"` TransferFrom *Transfer `json:"transfer_from"` TransferTo *Transfer `json:"transfer_to"` NetworkFees string `json:"network_fees"` Fees string `json:"fees"` FeeSymbol string `json:"fee_symbol"` BlockchainIds []string `json:"blockchain_ids"` TransactionId string `json:"transaction_id"` DestinationSymbol string `json:"destination_symbol"` }
type TransactionsMetadata ¶
type TransactionsMetadata struct {
Consensus *Consensus `json:"consensus"`
}
type UserAction ¶
type UserAction struct { Action string `json:"action"` UserId string `json:"user_id"` Timestamp string `json:"timestamp"` TransactionsMetadata *TransactionsMetadata `json:"transactions_metadata"` }
Source Files ¶
- call.go
- cancel_order.go
- client.go
- create_address_book_entry.go
- create_conversion.go
- create_order.go
- create_order_preview.go
- create_portfolio_allocations.go
- create_wallet.go
- create_wallet_transfer.go
- create_wallet_withdrawal.go
- credentials.go
- get_activity.go
- get_address_book.go
- get_entity_payment_method.go
- get_order.go
- get_portfolio.go
- get_portfolio_allocation.go
- get_portfolio_commission.go
- get_portfolio_credit.go
- get_transaction.go
- get_wallet.go
- get_wallet_balance.go
- get_wallet_deposit_instructions.go
- list_activities.go
- list_assets.go
- list_entity_users.go
- list_invoices.go
- list_open_orders.go
- list_order_fills.go
- list_orders.go
- list_portfolio_allocations.go
- list_portfolio_balances.go
- list_portfolio_transactions.go
- list_portfolio_users.go
- list_portfolios.go
- list_products.go
- list_wallet_balances.go
- list_wallet_transactions.go
- list_wallets.go
- model.go
- order_utils.go
- utils.go
Click to show internal directories.
Click to hide internal directories.