-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use glaze for secrets and coincenter info
- Loading branch information
Showing
6 changed files
with
135 additions
and
72 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,38 @@ | ||
#pragma once | ||
|
||
#include <unordered_map> | ||
|
||
#include "cct_const.hpp" | ||
#include "cct_json-serialization.hpp" | ||
#include "cct_string.hpp" | ||
|
||
namespace cct::schema { | ||
|
||
struct AccountOwner { | ||
string enName; | ||
string koName; | ||
|
||
using trivially_relocatable = is_trivially_relocatable<string>::type; | ||
}; | ||
|
||
struct APIKey { | ||
string key; | ||
string priv; // private is a reserved keyword - we override the json field name below | ||
string passphrase; | ||
AccountOwner accountOwner; | ||
|
||
using trivially_relocatable = is_trivially_relocatable<string>::type; | ||
}; | ||
|
||
using APIKeys = std::unordered_map<string, APIKey>; | ||
|
||
using APIKeysPerExchangeMap = std::unordered_map<ExchangeNameEnum, APIKeys>; | ||
|
||
} // namespace cct::schema | ||
|
||
template <> | ||
struct glz::meta<::cct::schema::APIKey> { | ||
using V = ::cct::schema::APIKey; | ||
static constexpr auto value = | ||
object("key", &V::key, "private", &V::priv, "passphrase", &V::passphrase, "accountOwner", &V::accountOwner); | ||
}; |