forked from thrasher-corp/gocryptotrader
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
script: implementation of error insertion on return (thrasher-corp#986)
* exchanges/account: shift credentials to account package and segregate funds to keys * merge: fixes * linter: fix * Update exchanges/account/account.go Co-authored-by: Scott <[email protected]> * glorious: nits + protection for string panic * glorious_suggestion: add method for matching keys * linter: fix tests * account: add protected method for credentials minimizing access, display full account details to rpc. * linter: spelling kweeeeeeen * accounts/portfolio: clean/check portfolio code and quickly check balances from change. Add protected method for future matching. * accounts: theres no point in pointerising everything * linter: ok pointerise this then... * exchanges: fix regression add in little notes. * glorious: nits * Update exchanges/account/credentials.go Co-authored-by: Scott <[email protected]> * Update exchanges/account/credentials_test.go Co-authored-by: Scott <[email protected]> * Update exchanges/account/credentials_test.go Co-authored-by: Scott <[email protected]> * glorious: nits * gloriously: fix glorious glorious test gloriously * script: initial implementation of error insertion on return * script: make script context aware(ish) and update error handle in examples * script: add tests * script: add syntax highlighting to readme * Update gctscript/vm/vm.go Co-authored-by: Scott <[email protected]> * Update gctscript/vm/vm.go Co-authored-by: Scott <[email protected]> * Update gctscript/examples/exchange/account_info.gct Co-authored-by: Scott <[email protected]> * Update gctscript/examples/exchange/cancel_order.gct Co-authored-by: Scott <[email protected]> * Update gctscript/examples/verbose.gct Co-authored-by: Scott <[email protected]> * Update gctscript/modules/gct/gct_test.go Co-authored-by: Scott <[email protected]> * glorious: nits * rm: bros * scripts: handle errors in examples when they are going to use the data after fetching * linter: fix rides again * SCOTT_SPELL_CHECK_LINTER: fix * gctscript: fix tests * glorious: niiiiiiiiiiiiits * scriptmodules/gct: standardize runtime errors * Update gctscript/modules/gct/exchange.go Co-authored-by: Scott <[email protected]> * Update gctscript/modules/gct/exchange.go Co-authored-by: Scott <[email protected]> * Update gctscript/modules/gct/exchange.go Co-authored-by: Scott <[email protected]> * Update gctscript/modules/gct/exchange.go Co-authored-by: Scott <[email protected]> * Update gctscript/modules/gct/gct.go Co-authored-by: Scott <[email protected]> * Update gctscript/modules/gct/gct.go Co-authored-by: Scott <[email protected]> * Update gctscript/modules/gct/gct.go Co-authored-by: Scott <[email protected]> * Update gctscript/modules/gct/gct.go Co-authored-by: Scott <[email protected]> * Update gctscript/modules/gct/gct.go Co-authored-by: Scott <[email protected]> * Update gctscript/modules/gct/gct.go Co-authored-by: Scott <[email protected]> * Update gctscript/modules/gct/gct.go Co-authored-by: Scott <[email protected]> * glorious: nits/reverts * go mod: tidy Co-authored-by: Ryan O'Hara-Reid <[email protected]> Co-authored-by: Scott <[email protected]>
- Loading branch information
1 parent
6858856
commit e93ee83
Showing
42 changed files
with
1,098 additions
and
360 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
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, "ftx", "spot") | ||
if is_error(info) { | ||
// handle error | ||
} | ||
|
||
fmt.println(info) | ||
} | ||
|
||
load() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.