sclass BitGetCredentials { settable S name; settable S apiKey; settable S passphrase; settable S secretKey; toString { ret joinNempties(" with ", spaceCombine(shortClassName(this), quoteOrEmpty(name)), commaCombine( nempty(apiKey) ? "apiKey " + roundBracket(nCharacters(apiKey)) : null, nempty(passphrase) ? "passphrase " + roundBracket(nCharacters(passphrase)) : null, nempty(secretKey) ? "secretKey " + roundBracket(nCharacters(secretKey)) : null)); } static BitGetCredentials fromFile(File f) { var credMap = parseColonPropertyCIMap(loadTextFile(f)); ret new BitGetCredentials() .apiKey(credMap.get("API-Key")) .passphrase(credMap.get("Passphrase")) .secretKey(credMap.get("SecretKey")) .name(credMap.get("Name")); } void save(File f) { saveTextFile(f, formatColonProperties(litorderedmap( "API-Key" := apiKey, "Passphrase" := passphrase, "SecretKey" := secretKey, "Name" := name ))); } bool complete() { ret nempty(apiKey) && nempty(passphrase) && nempty(secretKey); } }