-
Notifications
You must be signed in to change notification settings - Fork 0
/
coin.py
47 lines (37 loc) · 1.4 KB
/
coin.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from crypto import btc,eth,ltc,tron
def get_address_balance(symbol,memo):
print(symbol,memo)
match symbol:
case "BTC":
btc_from_seed = btc.BTCFromSeed(memo)
btc_instance = btc_from_seed.generate_btc_from_seed()
return btc_instance.address(),btc_instance.balance()
case "BTCT":
btc_from_seed = btc.BTCFromSeedTest(memo)
btc_instance = btc_from_seed.generate_btc_from_seed()
return btc_instance.address(),btc_instance.balance()
case "ETH":
eth_instance = eth.ETH(memo)
eth_address = eth_instance.address()
eth_balance = eth_instance.balance()
return eth_address, eth_balance / 1000000000000000000
case _:
return "0x"
return "0x"
def send_crypto(symbol,memo,to,amount):
print(symbol,memo)
match symbol:
case "BTC":
btc_from_seed = btc.BTCFromSeed(memo)
btc_instance = btc_from_seed.generate_btc_from_seed()
return btc_instance.send(to,amount)
case "BTCT":
btc_from_seed = btc.BTCFromSeedTest(memo)
btc_instance = btc_from_seed.generate_btc_from_seed()
return btc_instance.send(to,amount)
case "ETH":
eth_instance = eth.ETH(memo)
return eth_instance.send(to,amount)
case _:
return "0x"
return "0x"