From 1333f3934cd707e5d8565f97080fab49c7b83f45 Mon Sep 17 00:00:00 2001 From: John Peterson Date: Tue, 24 Sep 2024 13:43:23 -0400 Subject: [PATCH] [chore] Allow wallet.save_seed to create a file if necessary --- cdp/wallet.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cdp/wallet.py b/cdp/wallet.py index b7532c7..e5e81a8 100644 --- a/cdp/wallet.py +++ b/cdp/wallet.py @@ -473,8 +473,9 @@ def _existing_seeds(self, file_path: str) -> dict[str, Any]: """ seeds_in_file = {} - with open(file_path) as f: - seeds_in_file = json.load(f) + if os.path.exists(file_path): + with open(file_path) as f: + seeds_in_file = json.load(f) return seeds_in_file