diff --git a/assets/coin-icons/aibc.png b/assets/coin-icons/aibc.png new file mode 100644 index 000000000..28f17e26b Binary files /dev/null and b/assets/coin-icons/aibc.png differ diff --git a/assets/coin-icons/thc.png b/assets/coin-icons/thc.png deleted file mode 100644 index 90f8c8249..000000000 Binary files a/assets/coin-icons/thc.png and /dev/null differ diff --git a/assets/coin-icons/thc_bep20.png b/assets/coin-icons/thc_bep20.png deleted file mode 100644 index ab9d0a80c..000000000 Binary files a/assets/coin-icons/thc_bep20.png and /dev/null differ diff --git a/assets/coins.json b/assets/coins.json index 6eb443864..6c2aa18ff 100644 --- a/assets/coins.json +++ b/assets/coins.json @@ -460,6 +460,29 @@ }, "derivation_path": "m/44'/966'" }, + { + "coin": "AIBC", + "name": "aiblockchain", + "fname": "Aiblockchain", + "rpcport": 7772, + "pubtype": 23, + "p2shtype": 23, + "wiftype": 176, + "txfee": 0, + "dust": 5460, + "segwit": true, + "mm2": 1, + "required_confirmations": 11, + "avg_blocktime": 30, + "protocol": { + "type": "UTXO", + "bip44": "m/44'/2'/0'/0/0" + }, + "links": { + "github": "https://github.com/nickgsh/AiBlockChain", + "homepage": "https://aibc.space/" + } + }, { "coin": "ANKR-BEP20", "name": "ankr_bep20", @@ -10356,16 +10379,16 @@ "coin": "SUM", "name": "sumcoin", "fname": "Sumcoin", - "isPoS": 1, + "isPoS": 1, "sign_message_prefix": "Sumcoin Signed Message:\n", "rpcport": 3332, - "pubtype": 63, - "p2shtype": 125, - "wiftype": 187, - "decimals": 6, - "txfee": 0, - "dust": 1000, - "segwit": false, + "pubtype": 63, + "p2shtype": 125, + "wiftype": 187, + "decimals": 6, + "txfee": 0, + "dust": 10000, + "segwit": false, "bech32_hrp": "sum", "mm2": 1, "required_confirmations": 3, @@ -10818,43 +10841,6 @@ }, "derivation_path": "m/44'/714'" }, - { - "coin": "THC", - "sign_message_prefix": "Komodo Signed Message:\n", - "asset": "THC", - "fname": "HempCoin", - "rpcport": 36790, - "txversion": 4, - "overwintered": 1, - "mm2": 1, - "required_confirmations": 2, - "requires_notarization": true, - "avg_blocktime": 60, - "protocol": { - "type": "UTXO" - }, - "derivation_path": "m/44'/141'", - "trezor_coin": "Komodo" - }, - { - "coin": "THC-BEP20", - "name": "thc_bep20", - "fname": "HempCoin", - "rpcport": 80, - "mm2": 1, - "chain_id": 56, - "decimals": 18, - "avg_blocktime": 3, - "required_confirmations": 3, - "protocol": { - "type": "ERC20", - "protocol_data": { - "platform": "BNB", - "contract_address": "0xBD9a8CA934e673b874937761D7CFa7084ecBdd53" - } - }, - "derivation_path": "m/44'/714'" - }, { "coin": "TKL", "sign_message_prefix": "Komodo Signed Message:\n", diff --git a/assets/coins_config.json b/assets/coins_config.json index 499385ea1..149d437a7 100644 --- a/assets/coins_config.json +++ b/assets/coins_config.json @@ -1219,6 +1219,67 @@ ], "explorer_block_url": "block/" }, + "AIBC": { + "coin": "AIBC", + "type": "UTXO", + "name": "Aiblockchain", + "coinpaprika_id": "", + "coingecko_id": "", + "livecoinwatch_id": "", + "explorer_url": "http://95.111.231.8:3001/", + "explorer_tx_url": "", + "explorer_address_url": "", + "supported": [], + "active": false, + "is_testnet": false, + "currently_enabled": false, + "wallet_only": false, + "fname": "Aiblockchain", + "rpcport": 7772, + "pubtype": 23, + "p2shtype": 23, + "wiftype": 176, + "txfee": 0, + "dust": 5460, + "segwit": true, + "mm2": 1, + "required_confirmations": 11, + "avg_blocktime": 30, + "protocol": { + "type": "UTXO", + "bip44": "m/44'/2'/0'/0/0" + }, + "links": { + "github": "https://github.com/nickgsh/AiBlockChain", + "homepage": "https://aibc.space/" + }, + "electrum": [ + { + "url": "aibc.pro:50001", + "protocol": "TCP", + "contact": [ + { + "email": "electrum1_admin@aibc.pro" + }, + { + "github": "nickgsh" + } + ], + "ws_url": "aibc.pro:50002" + }, + { + "url": "aibcelectrum.com:50001", + "protocol": "TCP", + "contact": [ + { + "email": "nick@gshny.com" + } + ], + "ws_url": "aibcelectrum.com:50002" + } + ], + "explorer_block_url": "block/" + }, "ANKR-BEP20": { "coin": "ANKR-BEP20", "type": "BEP-20", @@ -4125,6 +4186,10 @@ { "url": "bbk-one.ewm-cx.net:50001", "protocol": "TCP" + }, + { + "url": "bbk-two.ewm-cx.net:50001", + "protocol": "TCP" } ], "explorer_block_url": "block/" @@ -4817,6 +4882,49 @@ "explorer_block_url": "block/", "binance_id": "BNB" }, + "BOLI": { + "coin": "BOLI", + "type": "UTXO", + "name": "Bolivarcoin", + "coinpaprika_id": "boli-bolivarcoin", + "coingecko_id": "bolivarcoin", + "livecoinwatch_id": "BOLI", + "explorer_url": "https://chainz.cryptoid.info/boli/", + "explorer_tx_url": "tx.dws?", + "explorer_address_url": "address.dws?", + "supported": [], + "active": false, + "is_testnet": false, + "currently_enabled": false, + "wallet_only": false, + "sign_message_prefix": "DarkCoin Signed Message:\n", + "fname": "Bolivarcoin", + "confpath": "USERHOME/.bolivarcoincore/bolivarcoin.conf", + "rpcport": 3563, + "pubtype": 85, + "p2shtype": 5, + "wiftype": 213, + "segwit": false, + "txfee": 10000, + "mm2": 1, + "required_confirmations": 3, + "avg_blocktime": 180, + "protocol": { + "type": "UTXO" + }, + "derivation_path": "m/44'/278'", + "links": { + "github": "https://github.com/BOLI-Project/BolivarCoin", + "homepage": "https://bolis.info" + }, + "electrum": [ + { + "url": "electrum2.bolivarcoin.tech:23001", + "protocol": "TCP" + } + ], + "explorer_block_url": "block.dws?" + }, "BONE-ERC20": { "coin": "BONE-ERC20", "type": "ERC-20", @@ -10208,11 +10316,6 @@ }, "derivation_path": "m/44'/18'", "electrum": [ - { - "url": "electrumx.dgc.ewmcx.org:50001", - "protocol": "TCP", - "ws_url": "electrumx.dgc.ewmcx.org:50003" - }, { "url": "failover.dgc.ewmcx.biz:50002", "protocol": "SSL", @@ -10415,29 +10518,6 @@ "type": "UTXO" }, "electrum": [ - { - "url": "electrumx1.diminutivecoin.com:50012", - "protocol": "SSL", - "disable_cert_verification": true, - "contact": [ - { - "email": "support@diminutivecoin.com" - }, - { - "twitter": "coin_dimi" - }, - { - "reddit": "DiminutiveCoin_DIMI" - }, - { - "github": "MadCatMining" - }, - { - "discord": "[MadCatMining]#0677" - } - ], - "ws_url": "electrumx1.diminutivecoin.com:50013" - }, { "url": "electrumx2.diminutivecoin.com:50012", "protocol": "SSL", @@ -21133,10 +21213,6 @@ }, "derivation_path": "m/44'/613'", "electrum": [ - { - "url": "electrumx.widecoin.org:50001", - "protocol": "TCP" - }, { "url": "electrumx2.widecoin.org:50001", "protocol": "TCP" @@ -21179,10 +21255,6 @@ }, "derivation_path": "m/44'/613'", "electrum": [ - { - "url": "electrumx.widecoin.org:50001", - "protocol": "TCP" - }, { "url": "electrumx2.widecoin.org:50001", "protocol": "TCP" @@ -29439,7 +29511,7 @@ "wiftype": 187, "decimals": 6, "txfee": 0, - "dust": 1000, + "dust": 10000, "segwit": false, "bech32_hrp": "sum", "mm2": 1, @@ -30837,96 +30909,6 @@ "token_address_url": "tokentxns?a=", "explorer_block_url": "block/" }, - "THC": { - "coin": "THC", - "type": "Smart Chain", - "name": "HempCoin", - "coinpaprika_id": "thc-hempcoin", - "coingecko_id": "hempcoin-thc", - "livecoinwatch_id": "THC", - "explorer_url": "https://thc.explorer.dexstats.info/", - "explorer_tx_url": "", - "explorer_address_url": "", - "supported": [], - "active": false, - "is_testnet": false, - "currently_enabled": false, - "wallet_only": false, - "sign_message_prefix": "Komodo Signed Message:\n", - "asset": "THC", - "fname": "HempCoin", - "rpcport": 36790, - "txversion": 4, - "overwintered": 1, - "mm2": 1, - "required_confirmations": 2, - "requires_notarization": true, - "avg_blocktime": 60, - "protocol": { - "type": "UTXO" - }, - "derivation_path": "m/44'/141'", - "trezor_coin": "Komodo", - "electrum": [ - { - "url": "2.eu.thc.electrum.dexstats.info:10020", - "contact": [ - { - "discord": "CHMEX#0686" - } - ] - } - ], - "explorer_block_url": "block/" - }, - "THC-BEP20": { - "coin": "THC-BEP20", - "type": "BEP-20", - "name": "HempCoin", - "coinpaprika_id": "thc-hempcoin", - "coingecko_id": "hempcoin-thc", - "livecoinwatch_id": "THC", - "explorer_url": "https://bscscan.com/", - "explorer_tx_url": "tx/", - "explorer_address_url": "address/", - "supported": [], - "active": false, - "is_testnet": false, - "currently_enabled": false, - "wallet_only": false, - "fname": "HempCoin", - "rpcport": 80, - "mm2": 1, - "chain_id": 56, - "decimals": 18, - "avg_blocktime": 3, - "required_confirmations": 3, - "protocol": { - "type": "ERC20", - "protocol_data": { - "platform": "BNB", - "contract_address": "0xBD9a8CA934e673b874937761D7CFa7084ecBdd53" - } - }, - "derivation_path": "m/44'/714'", - "contract_address": "0xBD9a8CA934e673b874937761D7CFa7084ecBdd53", - "parent_coin": "BNB", - "swap_contract_address": "0xeDc5b89Fe1f0382F9E4316069971D90a0951DB31", - "fallback_swap_contract": "0xeDc5b89Fe1f0382F9E4316069971D90a0951DB31", - "nodes": [ - { - "url": "https://bsc1.cipig.net:18655" - }, - { - "url": "https://bsc2.cipig.net:18655" - }, - { - "url": "https://bsc3.cipig.net:18655" - } - ], - "token_address_url": "tokentxns?a=", - "explorer_block_url": "block/" - }, "TKL": { "coin": "TKL", "type": "Smart Chain", @@ -36957,6 +36939,16 @@ { "url": "207.180.252.200:50011", "protocol": "TCP" + }, + { + "url": "zeta-seed-c.zetacoin.tech:50012", + "protocol": "SSL", + "ws_url": "zeta-seed-c.zetacoin.tech:50013" + }, + { + "url": "zeta-seed-d.zetacoin.network:50012", + "protocol": "SSL", + "ws_url": "zeta-seed-d.zetacoin.network:50013" } ], "explorer_block_url": "block.dws?" @@ -40908,17 +40900,6 @@ } ] }, - { - "url": "explorer.crionic.org:50001", - "contact": [ - { - "email": "diabatiis@gmail.com" - }, - { - "discord": "Diabaths#1919" - } - ] - }, { "url": "coin.crionic.org:50002", "protocol": "SSL", @@ -40931,19 +40912,6 @@ } ], "ws_url": "coin.crionic.org:50005" - }, - { - "url": "explorer.crionic.org:50002", - "protocol": "SSL", - "contact": [ - { - "email": "diabatiis@gmail.com" - }, - { - "discord": "Diabaths#1919" - } - ], - "ws_url": "explorer.crionic.org:50005" } ], "explorer_block_url": "block/" diff --git a/coins_ci.json b/coins_ci.json index 44951ee53..2107a2de5 100644 --- a/coins_ci.json +++ b/coins_ci.json @@ -1,3 +1,3 @@ { - "coins_repo_commit": "c360d9b2e0545fe601b62651728c638687bb0829" + "coins_repo_commit": "6304a79b48612ac40e806c78b67feb695044e728" } \ No newline at end of file diff --git a/lib/app_config/coin_converter.dart b/lib/app_config/coin_converter.dart index 24b0f6861..dc4c5fccf 100644 --- a/lib/app_config/coin_converter.dart +++ b/lib/app_config/coin_converter.dart @@ -132,6 +132,7 @@ String _getColor(String coin) { 'ADA': '#214D78', 'ADX': '#1B75BC', 'AGIX': '#6815FF', + 'AIBC': '#FFC745', 'ANKR': '#2075E8', 'ANT': '#33DAE6', 'APE': '#0052F2', @@ -155,6 +156,7 @@ String _getColor(String coin) { 'BLK': '#595959', 'BNB': '#F9D987', 'BNBT': '#F9D987', + 'BOLI': '#F09E40', 'BNT': '#0000FF', 'BOTS': '#F69B57', 'BRZ': '#B5DEC3', @@ -337,7 +339,6 @@ String _getColor(String coin) { 'SYS': '#0084C7', 'TEL': '#1BD8FF', 'TFT': '#80C7CF', - 'THC': '#819F6F', 'TKL': '#536E93', 'TRC': '#096432', 'TRX': '#F30031', diff --git a/lib/model/best_order.dart b/lib/model/best_order.dart index a86593781..e0e7f74b7 100644 --- a/lib/model/best_order.dart +++ b/lib/model/best_order.dart @@ -12,11 +12,14 @@ class BestOrders { if (json['result'] == null) return bestOrders; final Market action = bestOrders.request.action; + final Map result = json['result']; + final Map resultOrders = + result['orders'] as Map; - json['result'].forEach((String ticker, dynamic items) { + resultOrders.forEach((String ticker, dynamic items) { bestOrders.result ??= {}; final List list = []; - for (dynamic item in items) { + for (final Map item in items) { item['action'] = action; item['other_coin'] = action == Market.SELL ? bestOrders.request.coin : ticker; @@ -45,15 +48,24 @@ class BestOrder { }); factory BestOrder.fromJson(Map json) { + final Map price = json['price']; + final Map address = json['address']; + + // base_ max and min volume are used, as the base and rel coins are swapped + // for buy and sell orders, so the max volume is always the max volume of + // the base coin. The web wallet has a similar implementation. + final Map maxVolume = json['base_max_volume']; + final Map minVolume = json['base_min_volume']; + return BestOrder( - price: fract2rat(json['price_fraction']) ?? Rational.parse(json['price']), - maxVolume: fract2rat(json['max_volume_fraction']) ?? - Rational.parse(json['maxvolume']), - minVolume: fract2rat(json['min_volume_fraction']) ?? - Rational.parse(json['min_volume']), + price: fract2rat(price['fraction']) ?? Rational.parse(price['decimal']), + maxVolume: fract2rat(maxVolume['fraction']) ?? + Rational.parse(maxVolume['decimal']), + minVolume: fract2rat(minVolume['fraction']) ?? + Rational.parse(minVolume['decimal']), coin: json['coin'], otherCoin: json['other_coin'], - address: json['address'], + address: address['address_data'], action: json['action'], ); } diff --git a/lib/model/get_best_orders.dart b/lib/model/get_best_orders.dart index 942c9d898..a19be2d4a 100644 --- a/lib/model/get_best_orders.dart +++ b/lib/model/get_best_orders.dart @@ -8,6 +8,7 @@ class GetBestOrders { GetBestOrders({ this.userpass, this.method = 'best_orders', + this.mmrpc = '2.0', this.coin, this.volume, this.action, @@ -15,6 +16,7 @@ class GetBestOrders { String userpass; String method; + String mmrpc; String coin; Rational volume; Market action; @@ -22,11 +24,14 @@ class GetBestOrders { Map toJson() => { 'method': method, 'userpass': userpass, - 'coin': coin, - 'volume': { - 'numer': volume.numerator.toString(), - 'denom': volume.denominator.toString(), - }, - 'action': action == Market.BUY ? 'buy' : 'sell', + 'mmrpc': mmrpc, + 'params': { + 'coin': coin, + 'action': action == Market.BUY ? 'buy' : 'sell', + 'request_by': { + 'type': 'volume', + 'value': volume.toDecimalString(), + } + } }; } diff --git a/lib/model/swap_constructor_provider.dart b/lib/model/swap_constructor_provider.dart index cb2471990..09662d35c 100644 --- a/lib/model/swap_constructor_provider.dart +++ b/lib/model/swap_constructor_provider.dart @@ -332,11 +332,18 @@ class ConstructorProvider extends ChangeNotifier { BestOrder getTickerTopOrder(List tickerOrdersList, Market type) { final List sorted = List.from(tickerOrdersList); + // This code appears to remove orders placed by the current wallet + // so that the user doesn't trade with themselves sorted.removeWhere((BestOrder order) { final String coin = order.action == Market.SELL ? order.coin : order.otherCoin; final CoinBalance coinBalance = coinsBloc.getBalanceByAbbr(coin); - if (coinBalance == null) return false; + + // ZHTLC address is null (Shielded), so we can't check it. + // This removes the protection against users taking their own maker orders + if (coinBalance == null || order.address == null) { + return false; + } return coinBalance.balance.address.toLowerCase() == order.address.toLowerCase(); });