Ejemplo n.º 1
0
def givenewaddress_specifics():
  jsoninput=json.loads(request.data)

  public_address=str(jsoninput['public_address'])
  private_key=str(jsoninput['private_key'])

  coin_name=str(jsoninput['name'])
  color_amount=str(jsoninput['initial_coins'])
  dest_address=public_address
  description=str(jsoninput['description'])
  email=str(jsoninput['email'])

  fee_each=float(jsoninput['fee_each'])
  markup=0
  tosend=str(transactions.creation_cost(color_amount, coin_name, "", description, fee_each, markup))

  responsejson={}
  responsejson['name']=coin_name
  responsejson['minting_fee']=tosend
  responsejson['issuing_public_address']=public_address
  responsejson['issuing_private_key']=private_key
  responsejson=json.dumps(responsejson)

  amount_expected=str(int(float(tosend)*100000000))
  amount_received="0"
  amount_withdrawn="0"
  k=databases.add_address(public_address, private_key, amount_expected, amount_received, amount_withdrawn, coin_name, color_amount, dest_address, description, email)
  print k

  response=make_response(responsejson, 200)
  response.headers['Content-Type'] = 'application/json'
  response.headers['Access-Control-Allow-Origin']= '*'
  return response
Ejemplo n.º 2
0
def givenewaddress():
  pair=addresses.generate_secure_pair()
  public_address=pair['public_address']
  private_key=pair['private_key']

  jsoninput=json.loads(request.data)

  coin_name=jsoninput['coin_name']
  color_amount=jsoninput['issued_amount']
  dest_address=public_address
  description=jsoninput['description']
  email=jsoninput['email']
  fee_each=0.00005
  markup=1
  tosend=str(transactions.creation_cost(color_amount, coin_name, "", description, fee_each, markup))

  responsejson={}
  responsejson['name']=coin_name
  responsejson['minting_fee']=tosend
  responsejson['issuing_public_address']=public_address
  responsejson['issuing_private_key']=private_key
  responsejson=json.dumps(responsejson)

  amount_expected=str(int(float(tosend)*100000000))
  amount_received="0"
  amount_withdrawn="0"
  k=databases.add_address(public_address, private_key, amount_expected, amount_received, amount_withdrawn, coin_name, color_amount, dest_address, description, email)
  print k

  response=make_response(responsejson, 200)
  response.headers['Content-Type'] = 'application/json'
  response.headers['Access-Control-Allow-Origin']= '*'
  return response
Ejemplo n.º 3
0
def givenewaddress():
  pair=addresses.generate_secure_pair()
  public_address=pair['public_address']
  private_key=pair['private_key']

  coin_name=request.form['coin_name']
  color_amount=request.form['issued_amount']
  dest_address=request.form['destination_address']
  description=request.form['description']
  ticker=request.form['ticker']
  email=request.form['email']

  fee_each=0.00005
  markup=1
  tosend=str(transactions.creation_cost(color_amount, coin_name, coin_name, description, fee_each, markup))

  responsejson={}
  responsejson['name']=coin_name
  responsejson['minting_fee']=tosend
  responsejson['issuing_public_address']=public_address
  responsejson['issuing_private_key']=private_key
  responsejson=json.dumps(responsejson)

  color_address='SFSDF'#addresses.hashlib.sha256(coin_name).hexdigest() #FIGURE THIS OUT

  # #write address to db
  amount_expected=str(int(float(tosend)*100000000))
  amount_received="0"
  amount_withdrawn="0"
  k=databases.add_address(public_address, private_key, amount_expected, amount_received, amount_withdrawn, coin_name, color_amount, dest_address, description, ticker, email)
  print k

  response=make_response(responsejson, 200)
  response.headers['Access-Control-Allow-Origin']= '*'
  return response
Ejemplo n.º 4
0
def givenewaddress():
    pair = addresses.generate_secure_pair()
    public_address = pair['public_address']
    private_key = pair['private_key']

    coin_name = request.form['coin_name']
    color_amount = request.form['issued_amount']
    dest_address = request.form['destination_address']
    description = request.form['description']
    ticker = request.form['ticker']
    email = request.form['email']

    fee_each = 0.00005
    markup = 1
    tosend = str(
        transactions.creation_cost(color_amount, coin_name, coin_name,
                                   description, fee_each, markup))

    responsejson = {}
    responsejson['name'] = coin_name
    responsejson['minting_fee'] = tosend
    responsejson['issuing_public_address'] = public_address
    responsejson['issuing_private_key'] = private_key
    responsejson = json.dumps(responsejson)

    color_address = 'SFSDF'  #addresses.hashlib.sha256(coin_name).hexdigest() #FIGURE THIS OUT

    # #write address to db
    amount_expected = str(int(float(tosend) * 100000000))
    amount_received = "0"
    amount_withdrawn = "0"
    k = databases.add_address(public_address, private_key, amount_expected,
                              amount_received, amount_withdrawn, coin_name,
                              color_amount, dest_address, description, ticker,
                              email)
    print k

    response = make_response(responsejson, 200)
    response.headers['Access-Control-Allow-Origin'] = '*'
    return response
Ejemplo n.º 5
0
def givenewaddress_specifics():
    jsoninput = json.loads(request.data)

    public_address = str(jsoninput['public_address'])
    private_key = str(jsoninput['private_key'])

    coin_name = str(jsoninput['name'])
    color_amount = str(jsoninput['initial_coins'])
    dest_address = public_address
    description = str(jsoninput['description'])
    email = str(jsoninput['email'])

    fee_each = float(jsoninput['fee_each'])
    markup = 0
    tosend = str(
        transactions.creation_cost(color_amount, coin_name, "", description,
                                   fee_each, markup))

    responsejson = {}
    responsejson['name'] = coin_name
    responsejson['minting_fee'] = tosend
    responsejson['issuing_public_address'] = public_address
    responsejson['issuing_private_key'] = private_key
    responsejson = json.dumps(responsejson)

    amount_expected = str(int(float(tosend) * 100000000))
    amount_received = "0"
    amount_withdrawn = "0"
    k = databases.add_address(public_address, private_key, amount_expected,
                              amount_received, amount_withdrawn, coin_name,
                              color_amount, dest_address, description, email)
    print k

    response = make_response(responsejson, 200)
    response.headers['Content-Type'] = 'application/json'
    response.headers['Access-Control-Allow-Origin'] = '*'
    return response
Ejemplo n.º 6
0
def givenewaddress():
    pair = addresses.generate_secure_pair()
    public_address = pair['public_address']
    private_key = pair['private_key']

    jsoninput = json.loads(request.data)

    coin_name = jsoninput['coin_name']
    color_amount = jsoninput['issued_amount']
    dest_address = public_address
    description = jsoninput['description']
    email = jsoninput['email']
    fee_each = 0.00005
    markup = 1
    tosend = str(
        transactions.creation_cost(color_amount, coin_name, "", description,
                                   fee_each, markup))

    responsejson = {}
    responsejson['name'] = coin_name
    responsejson['minting_fee'] = tosend
    responsejson['issuing_public_address'] = public_address
    responsejson['issuing_private_key'] = private_key
    responsejson = json.dumps(responsejson)

    amount_expected = str(int(float(tosend) * 100000000))
    amount_received = "0"
    amount_withdrawn = "0"
    k = databases.add_address(public_address, private_key, amount_expected,
                              amount_received, amount_withdrawn, coin_name,
                              color_amount, dest_address, description, email)
    print k

    response = make_response(responsejson, 200)
    response.headers['Content-Type'] = 'application/json'
    response.headers['Access-Control-Allow-Origin'] = '*'
    return response