Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

26
LINES

< > BotCompany Repo | #1036019 // BitGetCredentials

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (9709L/54K).

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" : null,
        nempty(passphrase) ? "passphrase" : null,
        nempty(secretKey) ? "secretKey" : null));
  }
  
  static BitGetCredentials fromFile(File f) {
    var credMap = mapValues toSecretValue(parseColonPropertyCIMap(loadTextFile(f)));

    var cred = new BitGetCredentials;
    cred.apiKey(credMap.get("API-Key").get());
    cred.passphrase(credMap.get("Passphrase").get());
    cred.secretKey(credMap.get("secretKey").get());
    cred.name(credMap.get("Name").get());
    ret cred;
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): elmgxqgtpvxh, mqqgnosmbjvj, wnsclhtenguj

No comments. add comment

Snippet ID: #1036019
Snippet name: BitGetCredentials
Eternal ID of this version: #1036019/8
Text MD5: 928b3d932a5605d0e7f5008d8657f8f0
Transpilation MD5: 3fb2e28483523cb7cd4e0966f593f56e
Author: stefan
Category: javax / networking
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-09-19 17:23:33
Source code size: 803 bytes / 26 lines
Pitched / IR pitched: No / No
Views / Downloads: 18 / 56
Version history: 7 change(s)
Referenced in: [show references]