mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 23:16:45 +00:00
* exchanges: Start removal of FTX * Get tests happy again * okx: improve logic and add basic coverage * Fix linterino * Round 2 plus rm useless assignment in test * Fix exchange_wrapper_issues test error * Fix nitters * Address nitters
31 lines
1.1 KiB
Plaintext
31 lines
1.1 KiB
Plaintext
global := import("global")
|
|
exch := import("exchange")
|
|
fmt := import("fmt")
|
|
|
|
load := func() {
|
|
// 'ctx' is already defined when we construct our bytecode from file.
|
|
// It contains script ID and shortname of file as save details to default
|
|
// script output directory.
|
|
|
|
// Set account func allows the setting of account details via script
|
|
// which can then be passed into auth functions to specifically target
|
|
// different subaccounts while trading or retrieving fund details.
|
|
// Basic required implementation below:
|
|
ctx = global.set_account(ctx, "api_key_str", "api_secret_str")
|
|
|
|
// Full implementation:
|
|
// ctx = global.set_account(ctx, "api_key_str", "api_secret_str", "sub_account_str", "client_Id_str", "PEM_key_str", "OTP_Str")
|
|
|
|
// Set sub account func allows the setting of just the individual sub
|
|
// account details while utilizing the configured config.json apikeys.
|
|
// ctx = global.set_sub_account(ctx, "sub_account_str")
|
|
|
|
info := exch.accountinfo(ctx, "binance", "spot")
|
|
if is_error(info) {
|
|
// handle error
|
|
}
|
|
|
|
fmt.println(info)
|
|
}
|
|
|
|
load() |