Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
767 commits
Select commit Hold shift + click to select a range
6e41019
Change links on relevant (get-pip.py)
vivernet Nov 27, 2017
5236301
Merge pull request #1563 from vivernet/patch-1
achamely Dec 7, 2017
28da3c7
Merge pull request #140 from OmniLayer/master
achamely Dec 7, 2017
568fb35
check for coinbase
achamely Dec 7, 2017
400874d
Merge pull request #1565 from achamely/master
achamely Dec 7, 2017
5a671a0
Merge pull request #1566 from OmniLayer/master
achamely Dec 7, 2017
82002c2
update qs
achamely Dec 13, 2017
4dad4a2
Merge pull request #1567 from achamely/master
achamely Dec 13, 2017
7473d61
order utxo by size, adjust ref output
achamely Dec 18, 2017
2dd5b44
Merge pull request #1569 from achamely/master
achamely Dec 18, 2017
6f27f51
Merge pull request #1570 from OmniLayer/master
achamely Dec 18, 2017
572d3e0
fix miner fee to dec
achamely Dec 27, 2017
1ffb667
Merge pull request #1572 from achamely/master
achamely Dec 27, 2017
89c7a32
Merge pull request #1573 from OmniLayer/master
achamely Dec 27, 2017
31b0c79
additional error handling
achamely Jan 12, 2018
d36f91c
Merge pull request #1579 from achamely/master
achamely Jan 12, 2018
f8bb4f4
return string error
achamely Jan 12, 2018
adac06a
Merge pull request #1580 from achamely/master
achamely Jan 12, 2018
8a290ef
additional error handling for btc txs
achamely Jan 12, 2018
213cbb7
Merge pull request #1581 from achamely/master
achamely Jan 12, 2018
f49ae0e
add missing import
achamely Jan 12, 2018
8b2db22
Merge pull request #1582 from achamely/master
achamely Jan 12, 2018
0aef141
cleanup messages
achamely Jan 12, 2018
b96bcde
Merge pull request #1583 from achamely/master
achamely Jan 12, 2018
521d76b
Merge pull request #1584 from OmniLayer/master
achamely Jan 12, 2018
e4175ef
update helpdesk times
achamely Jan 15, 2018
d815a19
Merge pull request #1585 from achamely/master
achamely Jan 15, 2018
cc73254
Merge pull request #1588 from OmniLayer/master
achamely Jan 18, 2018
813468c
temp patch for bad reference output decimal rounding
achamely Jan 22, 2018
d8c39bf
Merge pull request #1589 from achamely/master
achamely Jan 22, 2018
d5179e7
show proxy load balanced ip in log
achamely Jan 31, 2018
fbf5647
Merge pull request #1591 from achamely/master
achamely Jan 31, 2018
6311936
use specified vout for intx
achamely Feb 5, 2018
72f775c
Merge pull request #1594 from achamely/master
achamely Feb 5, 2018
965713d
electrum preview example
achamely Feb 28, 2018
b46f0bd
check/skip adding pending tx if it exists
achamely Mar 7, 2018
25e7029
Merge pull request #1599 from achamely/master
achamely Mar 7, 2018
9ea80a0
update recaptcha to v2
achamely Mar 16, 2018
b4e9641
Merge pull request #1603 from achamely/master
achamely Mar 16, 2018
5c8bdfd
Merge pull request #1604 from OmniLayer/staging
achamely Mar 16, 2018
a3f9a1a
fix recaptcha module load when not homepage first
achamely Mar 18, 2018
5c067a7
Merge pull request #1605 from achamely/master
achamely Mar 18, 2018
d73263f
Merge pull request #1606 from OmniLayer/staging
achamely Mar 18, 2018
d7f843f
add filters to dex for replaced/confusing named coins
achamely Mar 30, 2018
270ad88
Merge pull request #1608 from achamely/master
achamely Mar 30, 2018
9c0a82b
Merge pull request #1609 from OmniLayer/staging
achamely Mar 30, 2018
18cb536
add support for grant/revoke transactions
achamely Apr 4, 2018
89c8c43
Merge pull request #1610 from achamely/master
achamely Apr 4, 2018
888c861
Merge pull request #1611 from OmniLayer/staging
achamely Apr 4, 2018
633f4c4
adjust min fee for property creation
achamely Apr 4, 2018
8ef0fa4
Merge pull request #1612 from achamely/master
achamely Apr 4, 2018
0d3401a
Merge pull request #1613 from OmniLayer/staging
achamely Apr 4, 2018
63c254b
Add support for changing issuer
achamely Apr 12, 2018
d4d5d97
Merge pull request #1615 from achamely/master
achamely Apr 12, 2018
7b0a335
Merge pull request #1616 from OmniLayer/staging
achamely Apr 12, 2018
209de7f
fix payload generation
achamely Apr 12, 2018
b87b69f
Merge pull request #1617 from achamely/master
achamely Apr 12, 2018
8ed307e
Merge pull request #1618 from OmniLayer/staging
achamely Apr 12, 2018
4ccce7f
additional warnings for change issuer
achamely Apr 12, 2018
7f8e681
Merge pull request #1619 from achamely/master
achamely Apr 12, 2018
eddc382
Merge pull request #1620 from OmniLayer/staging
achamely Apr 12, 2018
74ce9b7
update tagging
achamely Apr 13, 2018
b3b0152
Merge pull request #1621 from achamely/master
achamely Apr 13, 2018
a99b734
Merge pull request #1622 from OmniLayer/staging
achamely Apr 13, 2018
aa490e8
update contact us page info
achamely Apr 18, 2018
5f1d8c6
update contact us page info
achamely Apr 18, 2018
4d1e55d
Merge pull request #1623 from achamely/master
achamely Apr 18, 2018
67aebf6
Merge pull request #1624 from OmniLayer/staging
achamely Apr 18, 2018
9249cfb
migrate utxo lookups from blocktrail to btc.com
achamely Apr 23, 2018
04185cb
Merge pull request #1626 from achamely/master
achamely Apr 23, 2018
4ff9921
Merge pull request #1627 from OmniLayer/staging
achamely Apr 23, 2018
4ac93f4
remove unused enum query
achamely Apr 24, 2018
504194b
remove unused enum query
achamely Apr 24, 2018
93f1809
Merge pull request #1628 from achamely/master
achamely Apr 24, 2018
24d2a0a
Merge pull request #1629 from OmniLayer/staging
achamely Apr 24, 2018
614a248
update requests and use proper api path
achamely Apr 24, 2018
9abbfbc
Merge pull request #1630 from achamely/master
achamely Apr 24, 2018
b87bb4e
Merge pull request #1631 from OmniLayer/staging
achamely Apr 24, 2018
03828ae
remove unused check
achamely Apr 24, 2018
a90d903
Merge pull request #1632 from achamely/master
achamely Apr 24, 2018
bb3d247
Merge pull request #1633 from OmniLayer/staging
achamely Apr 24, 2018
2cd936d
add support for redeeming older 1of2 multisig outputs
achamely Apr 30, 2018
6667f87
Merge pull request #1636 from achamely/master
achamely Apr 30, 2018
213cba9
Merge pull request #1637 from OmniLayer/staging
achamely Apr 30, 2018
a8cb37a
skip multisig utxos
achamely May 1, 2018
adf5391
Merge pull request #1639 from achamely/master
achamely May 1, 2018
391a4ae
Merge pull request #1640 from OmniLayer/staging
achamely May 1, 2018
4ebf2d9
Update requirements.txt
a-savinov May 30, 2018
0b834a7
minor api performance tweaks, ui fixes
achamely Jun 1, 2018
deecf83
Merge pull request #1645 from achamely/master
achamely Jun 1, 2018
da0021b
Merge pull request #1644 from a-savinov/master
achamely Jun 1, 2018
1d820aa
cleanup confusing available
achamely Jun 7, 2018
758d136
Merge pull request #1646 from achamely/master
achamely Jun 7, 2018
c6f6f97
fix misaligned query rows
achamely Jun 7, 2018
fdba701
Merge pull request #1647 from achamely/master
achamely Jun 7, 2018
d0b2017
only query for value book if its changed
achamely Jun 11, 2018
f33bb25
dont overwrite builtin
achamely Jun 11, 2018
b969815
Merge pull request #1649 from achamely/master
achamely Jun 11, 2018
6b8597f
updated README
achamely Jul 10, 2018
6571e27
formatting
achamely Jul 10, 2018
8b220cf
db config api
achamely Jul 10, 2018
a453037
Merge pull request #1651 from achamely/master
achamely Jul 10, 2018
f02bb19
Merge pull request #1652 from OmniLayer/master
achamely Jul 10, 2018
db22feb
Merge pull request #1653 from OmniLayer/staging
achamely Jul 10, 2018
228ce57
cleanup deprecated calls
achamely Jul 11, 2018
a1323d3
cleanup send and remove / consolidate deprecated dependancies/calls
achamely Jul 11, 2018
c1f47c5
Merge pull request #1654 from achamely/master
achamely Jul 11, 2018
ba7d890
Merge pull request #1655 from OmniLayer/staging
achamely Jul 11, 2018
f092c65
additional deprecated call cleanup
achamely Jul 12, 2018
53bb689
remove testing setup
achamely Jul 12, 2018
6ef968a
Merge pull request #1656 from achamely/master
achamely Jul 12, 2018
b070846
Merge pull request #1657 from OmniLayer/staging
achamely Jul 12, 2018
b5472d0
update DEx filter list
achamely Jul 16, 2018
6bb8872
Merge pull request #1659 from achamely/master
achamely Jul 16, 2018
ec93e8e
Merge pull request #1660 from OmniLayer/staging
achamely Jul 16, 2018
65f29d8
validate search service query
achamely Jul 30, 2018
71ce3e8
Merge pull request #1662 from achamely/master
achamely Jul 30, 2018
96362c8
Merge pull request #1663 from OmniLayer/staging
achamely Jul 30, 2018
d1a7d89
cleanup dex market display and manage asset
achamely Aug 15, 2018
0a2ce7a
cleanup debug lines
achamely Aug 15, 2018
0dcc3a0
Merge pull request #1667 from achamely/master
achamely Aug 15, 2018
d4144e9
Merge pull request #1668 from OmniLayer/staging
achamely Aug 15, 2018
150b58d
fix import
achamely Sep 11, 2018
21135b6
sanitize update
achamely Sep 14, 2018
ae24e34
Merge pull request #1671 from achamely/master
achamely Sep 14, 2018
1bee07d
adjust for new db fields
achamely Nov 5, 2018
0c59a60
Merge pull request #1676 from achamely/master
achamely Nov 5, 2018
92c0fff
clean up tradable address list
achamely Nov 7, 2018
cfbdf17
Merge pull request #1678 from achamely/master
achamely Nov 7, 2018
f538ae2
Merge pull request #1679 from OmniLayer/staging
achamely Nov 7, 2018
0940807
update packages
achamely Nov 7, 2018
22cbd86
fix merge issue
achamely Nov 7, 2018
43ee7f4
Merge branch 'OmniLayer-staging-updated'
achamely Nov 7, 2018
6f2c475
Merge pull request #1680 from achamely/master
achamely Nov 7, 2018
2abddf3
Merge pull request #1681 from OmniLayer/staging
achamely Nov 7, 2018
4713943
fix unicode encoding error from new crypto library
achamely Nov 8, 2018
25faf02
Merge pull request #1682 from achamely/master
achamely Nov 8, 2018
5f83de6
Merge pull request #1683 from OmniLayer/staging
achamely Nov 8, 2018
6b655e9
fix unicode character encoding
achamely Nov 8, 2018
c109d0a
Merge pull request #1684 from achamely/master
achamely Nov 8, 2018
62ac885
Merge pull request #1685 from OmniLayer/staging
achamely Nov 8, 2018
0019f73
add warning message to export backup
achamely Nov 26, 2018
8d90921
Merge pull request #1687 from achamely/master
achamely Nov 26, 2018
651ade2
Merge pull request #1688 from OmniLayer/staging
achamely Nov 26, 2018
2321b67
double check if mfa code input needed before export
achamely Nov 26, 2018
39c9072
Merge pull request #1689 from achamely/master
achamely Nov 26, 2018
84178f0
Merge pull request #1690 from OmniLayer/staging
achamely Nov 26, 2018
d9b7e37
fix comma encoding
achamely Nov 28, 2018
b9714b6
Merge pull request #1691 from achamely/master
achamely Nov 28, 2018
bb285d8
Merge pull request #1692 from OmniLayer/staging
achamely Nov 28, 2018
655cf0b
use same balance response between single and bulk calls
achamely Dec 18, 2018
41a6316
Merge pull request #1695 from achamely/master
achamely Dec 18, 2018
57c7dac
split watch addresses into separate view with additional warnings
achamely Jan 9, 2019
af6c97e
fix broadcast message
achamely Jan 9, 2019
c93dbc2
Merge pull request #1697 from achamely/master
achamely Jan 9, 2019
874111c
fix marker address for offers
achamely Jan 21, 2019
8837624
Merge pull request #1700 from achamely/master
achamely Jan 21, 2019
c096aa0
update armory lib version
achamely Feb 4, 2019
34ff905
Merge pull request #1701 from achamely/master
achamely Feb 4, 2019
1530e8d
update explorer links
achamely Feb 12, 2019
275d6b9
Merge pull request #1703 from achamely/master
achamely Feb 12, 2019
696d246
fix private key import message
achamely Mar 4, 2019
c8a3b6a
Merge pull request #1706 from achamely/master
achamely Mar 4, 2019
e67caa7
fix layout/formatting
achamely Mar 18, 2019
a43d3b7
Merge pull request #1709 from achamely/master
achamely Mar 18, 2019
cdfb4b1
label/name updates
achamely Apr 12, 2019
7d0235d
Merge pull request #1716 from achamely/master
achamely Apr 12, 2019
0df4a54
remove unused library
achamely Apr 22, 2019
88811e4
Merge pull request #1717 from achamely/master
achamely Apr 22, 2019
7cac658
bug fix import address-priv key mismatch, update fees
achamely Apr 24, 2019
0f3cf11
Merge pull request #1718 from achamely/master
achamely Apr 24, 2019
fda8744
cleanup lang files
achamely Apr 30, 2019
836e3ea
Merge pull request #1721 from achamely/master
achamely Apr 30, 2019
7a3a6ed
fix name / symbol change in offers filters
achamely May 6, 2019
cd3c8de
Merge pull request #1722 from achamely/master
achamely May 6, 2019
706c77b
add wallet consistency checks
achamely May 8, 2019
382ed29
Merge pull request #1723 from achamely/master
achamely May 8, 2019
213c373
syntax fix
achamely May 8, 2019
bbf6295
Merge pull request #1724 from achamely/master
achamely May 8, 2019
26710b8
add check for wallet id field
achamely May 17, 2019
41ead86
Merge pull request #1726 from achamely/master
achamely May 17, 2019
048feb3
add helper text for destination address check
achamely Jul 26, 2019
8ab69fa
use better address validation
achamely Jul 26, 2019
a73a2c2
search by full txid
achamely Jul 26, 2019
9840903
check wallet state during login
achamely Jul 26, 2019
eb4bdf1
update ui search params to match api
achamely Jul 26, 2019
0f72497
update ui search params to match api
achamely Jul 26, 2019
fc0aa9f
syntax fix
achamely Jul 26, 2019
958049c
Merge pull request #1735 from achamely/master
achamely Jul 26, 2019
a4f8a58
add supported token tooltip/link
achamely Oct 22, 2019
f966262
Merge pull request #1742 from achamely/master
achamely Oct 22, 2019
fa8fb18
better error handling utxo lookup
achamely Oct 30, 2019
1c52ef7
Merge pull request #1746 from achamely/master
achamely Oct 30, 2019
c116c9d
Bump ecdsa from 0.10 to 0.13.3
dependabot[bot] Nov 1, 2019
183860d
update qr code generator
achamely Nov 6, 2019
3dd6f4d
Merge pull request #1748 from achamely/master
achamely Nov 6, 2019
f78956c
Bump bower from 1.3.12 to 1.8.8
dependabot[bot] Nov 6, 2019
d19009a
Merge pull request #1747 from OmniLayer/dependabot/pip/ecdsa-0.13.3
achamely Nov 6, 2019
3c8b876
Merge pull request #142 from OmniLayer/master
achamely Nov 6, 2019
5b44eab
update sale page text
achamely Nov 6, 2019
a6a54ec
Merge pull request #1751 from OmniLayer/dependabot/npm_and_yarn/bower…
achamely Nov 6, 2019
e579efc
package update sec vul fixes
achamely Nov 6, 2019
30d129e
cleanup imports
achamely Nov 6, 2019
b2455dc
Merge pull request #1752 from achamely/master
achamely Nov 6, 2019
ea9f23a
update werkzeug
achamely Nov 6, 2019
4a3b939
Merge pull request #1754 from achamely/master
achamely Nov 6, 2019
ec83e63
new cors config requirement for websocket and packet payload size update
achamely Nov 6, 2019
f943b7e
Merge pull request #1755 from achamely/master
achamely Nov 6, 2019
96ff8f8
adjust miner fee minimums
achamely Nov 14, 2019
d63e57a
cleanup modal display
achamely Nov 14, 2019
9284993
Merge pull request #1757 from achamely/master
achamely Nov 14, 2019
ca730fd
upgrade uwsgi
achamely Nov 25, 2019
ac10363
add french and disable cache
achamely Nov 25, 2019
82f154b
Merge pull request #1759 from achamely/master
achamely Nov 25, 2019
c3db9f9
add blockchaincom for utxo source
achamely Nov 26, 2019
6563b16
Merge pull request #1760 from achamely/master
achamely Nov 26, 2019
bdd3e0a
add testnet urls
achamely Jan 30, 2020
baf9dff
update watch only language
achamely Jan 31, 2020
2c00fe3
update blockchain libs
achamely Jan 31, 2020
afd01d1
spelling
achamely Jan 31, 2020
e4c00b7
Merge pull request #1762 from achamely/master
achamely Jan 31, 2020
829de43
syntax
achamely Jan 31, 2020
0463db1
Merge pull request #1763 from achamely/master
achamely Jan 31, 2020
f2ede5c
syntax fix
achamely Jan 31, 2020
9ab5e84
Merge pull request #1764 from achamely/master
achamely Jan 31, 2020
6275e25
update testnet explorer links
achamely Feb 11, 2020
b17f50e
Merge pull request #1765 from achamely/master
achamely Feb 11, 2020
1780c7a
add email address validation to create page
achamely Feb 28, 2020
602752c
Merge pull request #1766 from achamely/master
achamely Feb 28, 2020
3b17852
update rpc command
achamely Apr 6, 2020
40636d7
setup / switch to hcaptcha
achamely Apr 6, 2020
14968c1
add crowdsale close to manage menu
achamely Apr 21, 2020
bc7ff4a
update exchange for btc markets
achamely Jul 13, 2020
6d7302a
Merge pull request #1771 from achamely/master
achamely Jul 13, 2020
b88ae7e
update offers view
achamely Jul 13, 2020
be42bd0
Merge pull request #1772 from achamely/master
achamely Jul 13, 2020
c9b5858
fix filter for tradable asset addresses
achamely Jul 14, 2020
8f0735c
Merge pull request #1773 from achamely/master
achamely Jul 14, 2020
bc0b343
update for newer electrum
achamely Sep 30, 2020
5870861
update pending insert
Jan 22, 2021
862a7b0
Merge pull request #1779 from achamely/master
achamely Jan 22, 2021
7bb1c31
Merge pull request #143 from OmniLayer/master
achamely Sep 28, 2021
8b213a4
update balanceCheck
achamely Sep 28, 2021
39c11b7
Merge pull request #1785 from achamely/master
achamely Sep 28, 2021
22bc764
Merge pull request #1789 from OmniLayer/master
achamely Mar 1, 2022
c4417fd
fix translation
achamely Mar 1, 2022
f62fff6
Merge pull request #1790 from achamely/upstream-stage
achamely Mar 1, 2022
8736941
cleanup offers api
achamely May 19, 2022
33bc92f
Merge branch 'staging' of https://github.com/OmniLayer/omniwallet int…
achamely May 19, 2022
52ecc58
Merge pull request #1792 from achamely/upstream-stage
achamely May 19, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bowerrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "directory": "www/bower_components" }
{ "directory": "www/bower_components","registry": "https://registry.bower.io" }
1,210 changes: 127 additions & 1,083 deletions README.md

Large diffs are not rendered by default.

42 changes: 22 additions & 20 deletions api/armory_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,33 @@
import os, sys, re, random,pybitcointools, bitcoinrpc, math, hashlib
from decimal import Decimal
from flask import Flask, request, jsonify, abort, json, make_response
from msc_apps import *
tools_dir = os.environ.get('TOOLSDIR')
lib_path = os.path.abspath(tools_dir)
sys.path.append(lib_path)
data_dir_root = os.environ.get('DATADIR')
#from msc_apps import *
from rpcclient import *
#tools_dir = os.environ.get('TOOLSDIR')
#lib_path = os.path.abspath(tools_dir)
#sys.path.append(lib_path)
#data_dir_root = os.environ.get('DATADIR')

sys.path.append("/usr/lib/armory/")
#sys.path.append("/usr/lib/armory/")
sys.path.append("/usr/local/lib/armory/")
from armoryengine.ALL import *

app = Flask(__name__)
app.debug = True
conn = getRPCconn()

@app.route('/getunsigned', methods=['POST'])
def generate_unsigned():
unsigned_hex = request.form['unsigned_hex']
pubkey = request.form['pubkey']
ripemd160 = hashlib.new('ripemd160')
ripemd160.update(hashlib.sha256(hex_to_binary(pubkey)).digest())
pubKeyHash = binary_to_hex(ripemd160.digest())
#ripemd160 = hashlib.new('ripemd160')
#ripemd160.update(hashlib.sha256(hex_to_binary(pubkey)).digest())
#pubKeyHash = binary_to_hex(ripemd160.digest())
try:
tnet_ = request.form['testnet']
except KeyError, e:
tnet_ = 0
#Translate raw txn
decoded_tx = conn.decoderawtransaction(unsigned_hex)
decoded_tx = decoderawtransaction(unsigned_hex)['result']
#spending_txid= decoded_tx['vin'][0]['txid']
#spending_tx_raw = conn.getrawtransaction(spending_txid, False)
#spending_tx_decoded = conn.decoderawtransaction(spending_tx_raw)
Expand All @@ -44,14 +45,15 @@ def generate_unsigned():
i_k = []
for intx in decoded_tx['vin']:
spending_txid= intx['txid']
spending_tx_raw = conn.getrawtransaction(spending_txid, False)
spending_tx_decoded = conn.decoderawtransaction(spending_tx_raw)
i_vout = -1
for each in spending_tx_decoded['vout']:
info=each['scriptPubKey']['asm'].split(' ')
print "\nArmoryService: Searching for pubKey:", pubKeyHash, "| ASM Info:",info
if len(info) > 3 and info[0] != "OP_RETURN" and info[2] == pubKeyHash:
i_vout = each['n']
i_vout = intx['vout']
spending_tx_raw = getrawtransaction(spending_txid)['result']['hex']
#spending_tx_decoded = decoderawtransaction(spending_tx_raw)['result']
#i_vout = -1
#for each in spending_tx_decoded['vout']:
# info=each['scriptPubKey']['asm'].split(' ')
# print "\nArmoryService: Searching for pubKey:", pubKeyHash, "| ASM Info:",info
# if len(info) > 3 and info[0] != "OP_RETURN" and info[2] == pubKeyHash:
# i_vout = each['n']

i_k.append ({'contribid': '',
'contriblabel': '',
Expand All @@ -73,7 +75,7 @@ def generate_unsigned():
'magicbytes': tnet,
'p2shscript': '',
'txoutscript': o['scriptPubKey']['hex'],
'txoutvalue': int( o['value'] * Decimal(1e8) ),
'txoutvalue': int( Decimal(o['value']) * Decimal(1e8) ),
'version': 1,
'wltlocator': ''})

Expand Down
94 changes: 49 additions & 45 deletions api/balancehelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,10 @@ def get_balancedata(address):
atx.propertyid) s2
on s1.propertyid=s2.propertyid) f1
inner join smartproperties sp
on f1.propertyid=sp.propertyid and (sp.protocol='Omni' or sp.protocol='Mastercoin' or sp.protocol='Bitcoin')
on f1.propertyid=sp.propertyid and (sp.protocol='Omni' or sp.protocol='Bitcoin')
order by f1.propertyid""",(addr,addr))

balance_data = { 'balance': [] }
#out, err = run_command(TIMEOUT+ 'sx balance -j ' + addr )
#out, err = run_command(TIMEOUT+"curl -s http://btc.blockr.io/api/v1/address/balance/"+addr)
ret = bc_getbalance(addr)
out = ret['bal']
err = ret['error']
Expand All @@ -47,21 +45,22 @@ def get_balancedata(address):
res['pendingpos'] = str(long(balrow[3]))
res['pendingneg'] = str(long(balrow[4]))
if cID == '0':
#get btc balance from sx
#get btc balance from bc api's
if err != None or out == '':
btc_balance[ 'value' ] = str(long(-555))
#btc_balance[ 'value' ] = str(long(-555))
btc_balance[ 'value' ] = str(long(0))
btc_balance[ 'error' ] = True
else:
try:
if balrow[4] < 0:
#res['value'] = str(long( json.loads( out )[0][ 'paid' ]) + str(long(balrow[4]))
#res['value'] = str(long( json.loads( out )['data']['balance']*1e8) + str(long(balrow[4]))
res['value'] = str(long( out ) + long(balrow[4]))
else:
#res['value'] = str(long( json.loads( out )[0][ 'paid' ]))
#res['value'] = str(long( json.loads( out )['data']['balance']*1e8))
res['value'] = str(long( out ))
#if balrow[4] < 0:
# res['value'] = str(long( out ) + long(balrow[4]))
#else:
#unconfirmed btc already handled in api response
res['value'] = str(long( out ))
except ValueError:
btc_balance[ 'value' ] = str(long(-555))
#btc_balance[ 'value' ] = str(long(-555))
btc_balance[ 'value' ] = str(long(0))
btc_balance[ 'error' ] = True
else:
#get regular balance from db
if balrow[4] < 0:
Expand All @@ -80,16 +79,20 @@ def get_balancedata(address):
addbtc=False

if addbtc:
btc_balance = { 'symbol': 'BTC', 'divisible': True, 'id' : 0 }
btc_balance = { 'symbol': 'BTC', 'divisible': True, 'id' : 0, 'error' : False }
if err != None or out == '':
btc_balance[ 'value' ] = str(long(-555))
#btc_balance[ 'value' ] = str(long(-555))
btc_balance[ 'value' ] = str(long(0))
btc_balance[ 'error' ] = True
else:
try:
#btc_balance[ 'value' ] = str(long( json.loads( out )[0][ 'paid' ]))
#btc_balance[ 'value' ] = str(long( json.loads( out )['data']['balance']*1e8 ))
btc_balance[ 'value' ] = str(long( out ))
except ValueError:
btc_balance[ 'value' ] = str(long(-555))
#btc_balance[ 'value' ] = str(long(-555))
btc_balance[ 'value' ] = str(long(0))
btc_balance[ 'error' ] = True
btc_balance['pendingpos'] = str(long(0))
btc_balance['pendingneg'] = str(long(0))
balance_data['balance'].append(btc_balance)
Expand All @@ -99,15 +102,7 @@ def get_balancedata(address):


def get_bulkbalancedata(addresses):
list=""
for a in addresses:
if list == "":
list = a
else:
list += ","+a

baldata=bc_getbulkbalance(list)
btclist = baldata['bal']
btclist=bc_getbulkbalance(addresses)

retval = {}

Expand Down Expand Up @@ -138,16 +133,18 @@ def get_bulkbalancedata(addresses):
atx.propertyid) s2
on s1.propertyid=s2.propertyid) f1
inner join smartproperties sp
on f1.propertyid=sp.propertyid and (sp.protocol='Omni' or sp.protocol='Mastercoin' or sp.protocol='Bitcoin')
on f1.propertyid=sp.propertyid and (sp.protocol='Omni' or sp.protocol='Bitcoin')
order by f1.propertyid""",(addr,addr))

balance_data = { 'balance': [] }
#out, err = run_command(TIMEOUT+ 'sx balance -j ' + addr )
#out, err = run_command(TIMEOUT+"curl -s http://btc.blockr.io/api/v1/address/balance/"+addr)
if address in btclist:
out = btclist[address]
err = None
else:
try:
if address in btclist:
out = btclist[address]
err = None
else:
out = ''
err = "Missing"
except TypeError:
out = ''
err = "Missing"

Expand All @@ -160,19 +157,22 @@ def get_bulkbalancedata(addresses):
res['pendingpos'] = str(long(balrow[3]))
res['pendingneg'] = str(long(balrow[4]))
if cID == '0':
#get btc balance from sx
#get btc balance from bc api's
if err != None or out == '':
btc_balance[ 'value' ] = str(long(-555))
#btc_balance[ 'value' ] = str(long(-555))
btc_balance[ 'value' ] = str(long(0))
btc_balance[ 'error' ] = True
else:
try:
if balrow[4] < 0:
#res['value'] = str(long( json.loads( out )[0][ 'paid' ]) + str(long(balrow[4]))
res['value'] = str(long( out ) + long(balrow[4]))
else:
#res['value'] = str(long( json.loads( out )[0][ 'paid' ]))
res['value'] = str(long( out ))
#if balrow[4] < 0:
# res['value'] = str(long( out ) + long(balrow[4]))
#else:
#unconfirmed btc already handled in api response
res['value'] = str(long( out ))
except ValueError:
btc_balance[ 'value' ] = str(long(-555))
#btc_balance[ 'value' ] = str(long(-555))
btc_balance[ 'value' ] = str(long(0))
btc_balance[ 'error' ] = True
else:
#get regular balance from db
if balrow[4] < 0:
Expand All @@ -191,15 +191,19 @@ def get_bulkbalancedata(addresses):
addbtc=False

if addbtc:
btc_balance = { 'symbol': 'BTC', 'divisible': True, 'id' : 0 }
btc_balance = { 'symbol': 'BTC', 'divisible': True, 'id' : 0 ,'error' : False}
if err != None or out == '':
btc_balance[ 'value' ] = str(long(-555))
#btc_balance[ 'value' ] = str(long(-555))
btc_balance[ 'value' ] = str(long(0))
btc_balance[ 'error' ] = True
else:
try:
#btc_balance[ 'value' ] = str(long( json.loads( out )[0][ 'paid' ]))
btc_balance[ 'value' ] = str(long( out ))
except ValueError:
btc_balance[ 'value' ] = str(long(-555))
#btc_balance[ 'value' ] = str(long(-555))
btc_balance[ 'value' ] = str(long(0))
btc_balance[ 'error' ] = True
btc_balance['pendingpos'] = str(long(0))
btc_balance['pendingneg'] = str(long(0))
balance_data['balance'].append(btc_balance)
Expand Down
Loading