abcc

package
v0.0.0-...-5439e55 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: MIT Imports: 15 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DEFAULT_ID           = 51
	DEFAULT_TAKER_FEE    = 0.001
	DEFAULT_MAKER_FEE    = 0.001
	DEFAULT_LOT_SIZE     = 0.00000001
	DEFAULT_PRICE_FILTER = 0.00000001
	DEFAULT_TXFEE        = 0.005
	DEFAULT_WITHDRAW     = true
	DEFAULT_DEPOSIT      = true
	DEFAULT_CONFIRMATION = 2
	DEFAULT_LISTED       = true
)
View Source
const (
	API_URL string = "https://api.abcc.com"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Abcc

type Abcc struct {
	ID      int
	Name    string `bson:"name"`
	Website string `bson:"website"`

	API_KEY    string
	API_SECRET string

	Source    exchange.DataSource // / exchange API / microservicve api 1 / PSQL
	SourceURI string
}

func CreateAbcc

func CreateAbcc(config *exchange.Config) *Abcc

*************************************************

func (*Abcc) ApiKeyGET

func (e *Abcc) ApiKeyGET(strRequestPath string, mapParams map[string]string) string

************** Signature Http Request ************** Method: API Request and Signature is required Step 1: Change Instance Name (e *<exchange Instance Name>) Step 2: Create mapParams Depend on API Signature request Step 3: Add HttpGetRequest below strUrl if API has different requests

func (*Abcc) CanDeposit

func (e *Abcc) CanDeposit(coin *coin.Coin) bool

func (*Abcc) CanWithdraw

func (e *Abcc) CanWithdraw(coin *coin.Coin) bool

func (*Abcc) CancelAllOrder

func (e *Abcc) CancelAllOrder() error

func (*Abcc) CancelOrder

func (e *Abcc) CancelOrder(order *exchange.Order) error

func (*Abcc) DeleteCoin

func (e *Abcc) DeleteCoin(coin *coin.Coin)

func (*Abcc) DeletePair

func (e *Abcc) DeletePair(pair *pair.Pair)

func (*Abcc) DoAccountOperation

func (e *Abcc) DoAccountOperation(operation *exchange.AccountOperation) error

func (*Abcc) GetBalance

func (e *Abcc) GetBalance(coin *coin.Coin) float64

func (*Abcc) GetCoinBySymbol

func (e *Abcc) GetCoinBySymbol(symbol string) *coin.Coin

func (*Abcc) GetCoinConstraint

func (e *Abcc) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint

************** Coins on the Exchanges **************

func (*Abcc) GetCoins

func (e *Abcc) GetCoins() []*coin.Coin

func (*Abcc) GetCoinsData

func (e *Abcc) GetCoinsData() error

************** Public API ************** Get Coins Information (If API provide) Step 1: Change Instance Name (e *<exchange Instance Name>) Step 2: Add Model of API Response Step 3: Modify API Path(strRequestUrl)

func (*Abcc) GetConfirmation

func (e *Abcc) GetConfirmation(coin *coin.Coin) int

func (*Abcc) GetConstraintFetchMethod

func (e *Abcc) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod

*************** Exchange Constraint ***************

func (*Abcc) GetFee

func (e *Abcc) GetFee(pair *pair.Pair) float64

*************** Pair Constraint ***************

func (*Abcc) GetID

func (e *Abcc) GetID() int

*************** Exchange Information ***************

func (*Abcc) GetLotSize

func (e *Abcc) GetLotSize(pair *pair.Pair) float64

func (*Abcc) GetName

func (e *Abcc) GetName() exchange.ExchangeName

func (*Abcc) GetPairBySymbol

func (e *Abcc) GetPairBySymbol(symbol string) *pair.Pair

func (*Abcc) GetPairConstraint

func (e *Abcc) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint

************** Pairs on the Exchanges **************

func (*Abcc) GetPairs

func (e *Abcc) GetPairs() []*pair.Pair

func (*Abcc) GetPairsData

func (e *Abcc) GetPairsData() error
GetPairsData - Get Pairs Information (If API provide)

Step 1: Change Instance Name (e *<exchange Instance Name>) Step 2: Add Model of API Response Step 3: Modify API Path(strRequestUrl)

func (*Abcc) GetPriceFilter

func (e *Abcc) GetPriceFilter(pair *pair.Pair) float64

func (*Abcc) GetSymbolByCoin

func (e *Abcc) GetSymbolByCoin(coin *coin.Coin) string

func (*Abcc) GetSymbolByPair

func (e *Abcc) GetSymbolByPair(pair *pair.Pair) string

func (*Abcc) GetTradingWebURL

func (e *Abcc) GetTradingWebURL(pair *pair.Pair) string

func (*Abcc) GetTxFee

func (e *Abcc) GetTxFee(coin *coin.Coin) float64

*************** Coin Constraint ***************

func (*Abcc) HasPair

func (e *Abcc) HasPair(pair *pair.Pair) bool

func (*Abcc) InitData

func (e *Abcc) InitData() error

func (*Abcc) LimitBuy

func (e *Abcc) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)

func (*Abcc) LimitSell

func (e *Abcc) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)

func (*Abcc) ListOrders

func (e *Abcc) ListOrders() ([]*exchange.Order, error)

func (*Abcc) LoadPublicData

func (e *Abcc) LoadPublicData(operation *exchange.PublicOperation) error

func (*Abcc) OrderBook

func (e *Abcc) OrderBook(pair *pair.Pair) (*exchange.Maker, error)

Get Pair Market Depth Step 1: Change Instance Name (e *<exchange Instance Name>) Step 2: Add Model of API Response Step 3: Get Exchange Pair Code ex. symbol := e.GetPairCode(p) Step 4: Modify API Path(strRequestUrl) Step 5: Add Params - Depend on API request Step 6: Convert the response to Standard Maker struct

func (*Abcc) OrderStatus

func (e *Abcc) OrderStatus(order *exchange.Order) error

func (*Abcc) SetCoinConstraint

func (e *Abcc) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)

func (*Abcc) SetPairConstraint

func (e *Abcc) SetPairConstraint(pairConstraint *exchange.PairConstraint)

func (*Abcc) UpdateAllBalances

func (e *Abcc) UpdateAllBalances()

func (*Abcc) UpdateConstraint

func (e *Abcc) UpdateConstraint()

func (*Abcc) Withdraw

func (e *Abcc) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool

type AccountBalances

type AccountBalances []struct {
	Currency      string  `json:"Currency"`
	Balance       float64 `json:"Balance"`
	Available     float64 `json:"Available"`
	Pending       float64 `json:"Pending"`
	CryptoAddress string  `json:"CryptoAddress"`
	Requested     bool    `json:"Requested"`
	Uuid          string  `json:"Uuid"`
}

type JsonResponse

type JsonResponse struct {
	Success bool            `json:"success"`
	Message string          `json:"message"`
	Result  json.RawMessage `json:"result"`
}

type OrderBook

type OrderBook struct {
	Timestamp int        `json:"timestamp"`
	Asks      [][]string `json:"asks"`
	Bids      [][]string `json:"bids"`
}

type PairsData

type PairsData struct {
	Markets []struct {
		ID              int    `json:"id"`
		Code            string `json:"code"`
		Name            string `json:"name"`
		BaseUnit        string `json:"base_unit"`
		QuoteUnit       string `json:"quote_unit"`
		PriceFixed      int    `json:"price_fixed"`
		VolumeFixed     int    `json:"volume_fixed"`
		Fee             string `json:"fee"`
		MarketPartition string `json:"market_partition"`
	}
}

type PlaceOrder

type PlaceOrder struct {
	AccountId                  string
	OrderUuid                  string `json:"OrderUuid"`
	Exchange                   string `json:"Exchange"`
	Type                       string
	Quantity                   float64 `json:"Quantity"`
	QuantityRemaining          float64 `json:"QuantityRemaining"`
	Limit                      float64 `json:"Limit"`
	Reserved                   float64
	ReserveRemaining           float64
	CommissionReserved         float64
	CommissionReserveRemaining float64
	CommissionPaid             float64
	Price                      float64 `json:"Price"`
	PricePerUnit               float64 `json:"PricePerUnit"`
	Opened                     string
	Closed                     string
	IsOpen                     bool
	Sentinel                   string
	CancelInitiated            bool
	ImmediateOrCancel          bool
	IsConditional              bool
	Condition                  string
	ConditionTarget            float64
}

type Uuid

type Uuid struct {
	Id string `json:"uuid"`
}

Jump to

Keyboard shortcuts

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