Files
gocryptotrader/gctscript/examples/account.gct
Adrian Gallagher c785ae73a7 exchanges: Remove FTX implementation and fix minor test issues (#1100)
* 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
2023-01-25 16:40:04 +11:00

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()