feat: add negative topups (#2835)

* feat: add negative topups
* remove topup dialog

---------

Co-authored-by: Vlad Stan <stan.v.vlad@gmail.com>
This commit is contained in:
dni ⚡
2024-12-17 21:06:58 +01:00
committed by GitHub
co-authored by Vlad Stan
parent 368da935db
commit 37187bfc2c
20 changed files with 121 additions and 145 deletions
+16 -1
View File
@@ -1,6 +1,6 @@
import base64
import getpass
from hashlib import md5
from hashlib import md5, pbkdf2_hmac, sha256
from Cryptodome import Random
from Cryptodome.Cipher import AES
@@ -8,6 +8,21 @@ from Cryptodome.Cipher import AES
BLOCK_SIZE = 16
def random_secret_and_hash() -> tuple[str, str]:
secret = Random.new().read(32)
return secret.hex(), sha256(secret).hexdigest()
def fake_privkey(secret: str) -> str:
return pbkdf2_hmac(
"sha256",
secret.encode(),
b"FakeWallet",
2048,
32,
).hex()
class AESCipher:
"""This class is compatible with crypto-js/aes.js