
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
github.com/testingaccmar/ccxt_beyang_binance
This is a package for beYANG CCXT library to work with Binance API
Translations:
go get github.com/beyang-crypto/CCXT_beYANG_Binance
Spot/Margin
Wallet:
Name | Binance_API | CCXT_BeYANG | Description |
---|---|---|---|
User Asset | ![]() | CCXT_BeYANG | Get user assets, just for positive data. |
Market Data:
Name | Binance_API | CCXT_BeYANG | Description |
---|---|---|---|
Check Server Time | ![]() | CCXT_BeYANG | Test connectivity to the Rest API and get the current server time. |
Exchange Information | ![]() | CCXT_BeYANG | Current exchange trading rules and symbol information |
Order Book | ![]() | CCXT_BeYANG | |
24hr Ticker Price Change Statistics | ![]() | CCXT_BeYANG | 24 hour rolling window price change statistics. Careful when accessing this with no symbol. |
Spot Account:
Name | Binance_API | CCXT_BeYANG | Description |
---|---|---|---|
Account Information | ![]() | CCXT_BeYANG | Get current account information |
Account Trade List | ![]() | CCXT_BeYANG | Get trades for a specific account and symbol |
New Order | ![]() | CCXT_BeYANG | Send in a new order. |
Test New Order | ![]() | CCXT_BeYANG | Test new order creation and signature/recvWindow long. Creates and validates a new order but does not send it into the matching engine. |
Query Open OCO | ![]() | CCXT_BeYANG | |
Query Order | ![]() | CCXT_BeYANG | Check an order's status |
Margin account
Name | Binance_API | CCXT_BeYANG | Description |
---|---|---|---|
Margin Account Repay | ![]() | CCXT_BeYANG | Repay loan for margin account |
Get All Cross Margin Pairs | ![]() | CCXT_BeYANG | |
Query Margin PriceIndex | ![]() | CCXT_BeYANG | |
New Order | ![]() | CCXT_BeYANG | Post a new order for margin account. |
Query Loan Record | ![]() | CCXT_BeYANG | |
Query Cross Margin Account Details | ![]() | CCXT_BeYANG | |
Query Open OCO | ![]() | CCXT_BeYANG | |
Query Order | ![]() | CCXT_BeYANG |
Websocket Market Streams
Name | Binance_API | CCXT_BeYANG | Description |
---|---|---|---|
Kline/Candlestick Streams | ![]() | CCXT_BeYANG Client | The Kline/Candlestick Stream push updates to the current klines/candlestick every second. |
Individual Symbol Book Ticker Streams | ![]() | CCXT_BeYANG Client | Pushes any update to the best bid or ask's price or quantity in real-time for a specified symbol |
Futures
Name | Binance_API | CCXT_BeYANG | Description |
---|---|---|---|
Get Funding Rate History | ![]() | CCXT_BeYANG |
Name | Binance_API | CCXT_BeYANG | Description |
---|---|---|---|
Mark Price Stream | ![]() | CCXT_BeYANG Client | Mark price and funding rate for a single symbol pushed every 3 seconds or every second |
Mark Price Stream for All market | ![]() | CCXT_BeYANG Client | Mark price and funding rate for all symbols pushed every 3 seconds or every second |
Kline/Candlestick Streams | ![]() | CCXT_BeYANG Client | The Kline/Candlestick Stream push updates to the current klines/candlestick every 250 milliseconds (if existing). |
Individual Symbol Book Ticker Streams | ![]() | CCXT_BeYANG Client | Pushes any update to the best bid or ask's price or quantity in real-time for a specified symbol. |
Name | Binance_API | CCXT_BeYANG | Description |
---|---|---|---|
New Order | ![]() | CCXT_BeYANG | Send in a new order. |
Query Order | ![]() | CCXT_BeYANG | Check an order's status. |
|
Create configuration object. More in README
package main
import (
"github.com/beyang-crypto/CCXT_beYANG/config"
. "github.com/beyang-crypto/CCXT_beYANG_Binance/binance/spotAndMargin/rest/enums"
)
func main() {
path := "config-prod.yaml" // путpath to configuration file
cfg := config.NewAuth(path, 0, MainnetEndpoint, true)
// <...>
}
Create configuration object by passing config object and relative path to logger file for logging purposes.
b := New(cfg, "binanceRespLog.log")
Create a structure with parameters necessary for the function. In this example we use Test New Order function. Test New Order in library Test New Order in Binance API
path := "config-prod.yaml" // path to configuration file
cfg := config.NewAuth(path, 0, TestnetEndpoint, true)
connRest := client.New(cfg, "binanceRespLog.log")
symbol, _ := connRest.GetPair("btc", "usdt")
parm := spotRest.TestNewOrderParam{
Symbol: symbol,
Side: OrderSideBUY,
Type: OrderTypeLimit,
TimeInForce: TimeInForceGTC,
Quantity: 0.01,
NewClientOrderId: "my_order_id_1",
Price: 9000.0,
}
Launch
ans, err := spotRest.TestNewOrder(connRest, parm)
if err != nil {
log.Fatalln(err)
}
log.Printf("MAIN response %v", ans)
Create configuration object. More in README CCXT_BeYANG
cfg := NewConfiguration(binanceWs.HostBaseUrl_1, true)
Create a structure with parameters necessary for the function. In this example we use Test New Order function.
connWs := binanceWs.New(ws.FuturesTrading, cfg, "binanceTestLog.log")
connWs.Start()
Create pair(s) and subscribe to the channels we need. We create an array of currency pairs to which we will subscribe, inside one connection.
symbols1 := []string{
"btc", // btcusdt
"eth", // ethusdt
"xrp", // xrpusdt
"ada", // adausdt
"sol", // solusdt
"doge", // dogeusdt
"matic", // maticusdt
"shib", // shibusdt
"trx", // trxusdt
"uni", // uniusdt
"avax", // avaxusdt
"ltc", // ltcusdt
"etc", // etcusdt
"link", // linkusdt
"atom", // atomusdt
}
symbol2 := "usdt"
var pairs []string
for _, symbol1 := range symbols1 {
pairs = append(pairs, connWs.GetPair(symbol1, symbol2))
}
ws.Subscribe(connWs, binanceWs.ChannelTicker, pairs)
Connect to the stream with the channel to which we just subscribed, pass the callback as an argument. Callback-function example:
func handleBookTicker(name string, symbol string, data binanceWs.BookTicker) {
log.Printf("%s Ticker %s: %v", name, symbol, data)
}
Connection:
connWs.GetEmitter().On(binanceWs.ChannelTicker, handleBookTicker)
Create a channel so that the function doesn't end. This is necessary to keep the app alive.
forever := make(chan struct{})
<-forever
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.