def create_transfer(recipient, amount): ''' Create the transfer transaction (v2) with the mosaics. :param recipient: Address to which XQC will be sent. :param amount: Number of XQC to send. ''' time_stamp = nem.new_time_stamp() mosaic = nem.Mosaic(MOSAIC_DEFINITION.mosaic_id, int(amount)) return nem.TransferTransaction(time_stamp=time_stamp, signature='', fee=estimate_fee(mosaic), type=nem.Transfer, deadline=time_stamp + datetime.timedelta(hours=1).seconds, version=nem.TestNetworkVersion, signer=CONFIG['public_key'], relative_version=2, amount=0, recipient=recipient, message=MESSAGE, mosaics=[mosaic])
def transfer_max_error(): '''Return a bad request.''' return nem.Error(nem.new_time_stamp(), "FAILURE_TRANSFER_MAX_EXCEEDED", None, 400)
def invalid_amount_error(): '''Return am invalid amount error.''' return nem.Error(nem.new_time_stamp(), "FAILURE_INVALID_AMOUNT", "Amount must be greater than 0.", 400)
def daily_max_error(): '''Return a bad request.''' return nem.Error(nem.new_time_stamp(), "FAILURE_DAILY_MAX_EXCEEDED", None, 400)
def bad_request_error(): '''Return a bad request.''' return nem.Error(nem.new_time_stamp(), "BAD_REQUEST", None, 400)