Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, address='', publicKey='', privateKey='', seed='', alias='', nonce=0):
if nonce<0 or nonce>4294967295:
raise ValueError('Nonce must be between 0 and 4294967295')
if seed:
self._generate(seed=seed, nonce=nonce)
elif publicKey:
self._generate(publicKey=publicKey)
elif address:
if not pywaves.validateAddress(address):
raise ValueError("Invalid address")
else:
self.address = address
self.publicKey = publicKey
self.privateKey = privateKey
self.seed = seed
self.nonce = nonce
elif alias and not pywaves.OFFLINE:
self.address = pywaves.wrapper('/alias/by-alias/%s' % alias).get("address", "")
self.publicKey = ''
self.privateKey = ''
self.seed = ''
self.nonce = 0
elif privateKey == '' or privateKey:
if len(privateKey) == 0:
raise ValueError('Empty private key not allowed')