Spaces:
Runtime error
Runtime error
Commit
·
30bd486
1
Parent(s):
f9dc111
check for input private key
Browse files
app.py
CHANGED
|
@@ -12,13 +12,13 @@ ocean = Ocean(config)
|
|
| 12 |
|
| 13 |
def wallet(private_key):
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
# address = account.address
|
| 20 |
-
|
| 21 |
|
|
|
|
|
|
|
| 22 |
|
| 23 |
wallet = Wallet(ocean.web3, private_key, transaction_timeout=20, block_confirmations=config.block_confirmations)
|
| 24 |
|
|
@@ -27,7 +27,7 @@ def wallet(private_key):
|
|
| 27 |
eth_balance = from_wei(ocean.web3.eth.get_balance(address))
|
| 28 |
ocean_balance = from_wei(OCEAN_token.balanceOf(address))
|
| 29 |
|
| 30 |
-
return
|
| 31 |
|
| 32 |
# def wallet(private_key, did):
|
| 33 |
# wallet = Wallet(ocean.web3, private_key, transaction_timeout=20, block_confirmations=config.block_confirmations)
|
|
|
|
| 12 |
|
| 13 |
def wallet(private_key):
|
| 14 |
|
| 15 |
+
if private_key:
|
| 16 |
+
pass
|
| 17 |
+
else:
|
| 18 |
+
account, mnemonic = get_wallet()
|
|
|
|
|
|
|
| 19 |
|
| 20 |
+
private_key = account.key.hex()
|
| 21 |
+
address = account.address
|
| 22 |
|
| 23 |
wallet = Wallet(ocean.web3, private_key, transaction_timeout=20, block_confirmations=config.block_confirmations)
|
| 24 |
|
|
|
|
| 27 |
eth_balance = from_wei(ocean.web3.eth.get_balance(address))
|
| 28 |
ocean_balance = from_wei(OCEAN_token.balanceOf(address))
|
| 29 |
|
| 30 |
+
return address, mnemonic, eth_balance, ocean_balance
|
| 31 |
|
| 32 |
# def wallet(private_key, did):
|
| 33 |
# wallet = Wallet(ocean.web3, private_key, transaction_timeout=20, block_confirmations=config.block_confirmations)
|