diff --git a/app/constants.js b/app/constants.js index 5ece229df9..899b83b669 100644 --- a/app/constants.js +++ b/app/constants.js @@ -24,13 +24,14 @@ exports.appViews = [ ]; exports.defaultEnabledCurrencies = [ + 'BTC', + 'KMD', 'CHIPS', 'DOGE', - 'KMD', 'MORTY', 'RICK', 'SUPERNET', - + 'ETH', // These are left out for now. // TODO: Revise this list when HyperDEX is more mature. // 'BCH', @@ -47,8 +48,8 @@ exports.defaultEnabledCurrencies = [ ]; exports.alwaysEnabledCurrencies = [ - 'KMD', - 'CHIPS', + 'BTC', + 'KMD' ]; exports.ignoreExternalPrice = new Set([ @@ -57,6 +58,8 @@ exports.ignoreExternalPrice = new Set([ 'REVS', 'RICK', 'SUPERNET', + "BET", + "HODL", ]); exports.hiddenCurrencies = []; diff --git a/app/locales/en-US/swap.json b/app/locales/en-US/swap.json index 09cee44a04..d6b30deb47 100644 --- a/app/locales/en-US/swap.json +++ b/app/locales/en-US/swap.json @@ -5,6 +5,8 @@ "title": "Swap", "details": { "broadcast": "Broadcast", + "maker": "Maker", + "taker": "Taker", "buy": "Buy", "copyDebugData": "Copy Swap Debug Data", "exchanging": "Exchanging", @@ -55,6 +57,7 @@ "reverted": "Reverted", "pending": "Pending", "open": "Open", + "active": "Open", "unmatched": "Unmatched", "cancelled": "Cancelled" }, diff --git a/app/marketmaker/index.js b/app/marketmaker/index.js index c93cd542c6..6bd36e5473 100644 --- a/app/marketmaker/index.js +++ b/app/marketmaker/index.js @@ -93,7 +93,11 @@ class Marketmaker { ...options, gui: 'hyperdex', userhome: os.homedir(), + netid: 9999, // TODO: Set this to `0` when mm v2 is production ready + // netid: 2323, + // seednodes: ['35.173.213.220'], + rpcport: port, rpccors: is.development ? 'http://localhost:8080' : 'app://-', coins, diff --git a/app/marketmaker/supported-currencies.js b/app/marketmaker/supported-currencies.js index b2f920167a..783d5b08f6 100644 --- a/app/marketmaker/supported-currencies.js +++ b/app/marketmaker/supported-currencies.js @@ -10,24 +10,6 @@ We use the `name` property only when the currency is not on `coinmarketcap.com`. */ const supportedCurrencies = [ - { - coin: '$PAC', - rpcport: 7111, - pubtype: 55, - p2shtype: 10, - wiftype: 204, - txfee: 10000, - electrumServers: [ - { - host: 'electrum.paccoin.io', - port: 50001, - }, - { - host: 'electro-pac.paccoin.io', - port: 50001, - }, - ], - }, { coin: '1ST', name: 'FirstBlood', @@ -52,12 +34,6 @@ const supportedCurrencies = [ contractAddress: '0x4DC3643DbC642b72C158E7F3d2ff232df61cb6CE', rpcport: 80, }, - { - coin: 'ANN', - name: 'Agent Not Needed', - contractAddress: '0xe0e73E8fc3a0fA161695be1D75E1Bc3E558957c4', - rpcport: 80, - }, { coin: 'ANT', name: 'Aragon', @@ -76,18 +52,6 @@ const supportedCurrencies = [ contractAddress: '0x0D8775F648430679A709E98d2b0Cb6250d2887EF', rpcport: 80, }, - { - coin: 'BBT', - name: 'Bitboost', - contractAddress: '0x1500205f50bf3FD976466d0662905c9ff254fc9c', - rpcport: 80, - }, - { - coin: 'BCAP', - name: 'Bcap', - contractAddress: '0xFf3519eeeEA3e76F1F699CCcE5E23ee0bdDa41aC', - rpcport: 80, - }, { coin: 'BCH', rpcport: 33333, @@ -111,10 +75,28 @@ const supportedCurrencies = [ ], }, { - coin: 'BITSOKO', - name: 'Bitsoko', - contractAddress: '0xB72627650F1149Ea5e54834b2f468E5d430E67bf', - rpcport: 80, + coin: 'BET', + asset: 'BET', + fname: 'BET', + name: "BET", + rpcport: 14250, + txversion: 4, + overwintered: 1, + required_confirmations: 2, + electrumServers: [ + { + host: 'electrum1.cipig.net', + port: 10012, + }, + { + host: 'electrum2.cipig.net', + port: 10012, + }, + { + host: 'electrum3.cipig.net', + port: 10012, + }, + ], }, { coin: 'BNB', @@ -151,12 +133,6 @@ const supportedCurrencies = [ }, ], }, - { - coin: 'BOX', - name: 'Beonbox', - contractAddress: '0x01E579BE97433f861340268521A7a2ab9829082C', - rpcport: 80, - }, { coin: 'BTC', rpcport: 8332, @@ -201,12 +177,6 @@ const supportedCurrencies = [ }, ], }, - { - coin: 'BTCL', - name: 'BTC Lite', - contractAddress: '0x5acD19b9c91e596b1f062f18e3D02da7eD8D1e50', - rpcport: 80, - }, { coin: 'BTG', rpcport: 12332, @@ -225,18 +195,18 @@ const supportedCurrencies = [ }, ], }, - { - coin: 'BTK', - name: 'BitcoinToken', - contractAddress: '0xdb8646F5b487B5Dd979FAC618350e85018F557d4', - rpcport: 80, - }, { coin: 'BTM', name: 'Bytom', contractAddress: '0xcB97e65F07DA24D46BcDD078EBebd7C6E6E3d750', rpcport: 80, }, + { + coin: 'BUSD', + name: 'Binance USD', + contractAddress: '0x4Fabb145d64652a948d72533023f6E7A623C7C53', + rpcport: 80, + }, { coin: 'CDT', name: 'Blox', @@ -249,12 +219,6 @@ const supportedCurrencies = [ contractAddress: '0x1122B6a0E00DCe0563082b6e2953f3A943855c1F', rpcport: 80, }, - { - coin: 'CFI', - name: 'Cofound.it', - contractAddress: '0x12FEF5e57bF45873Cd9B62E9DBd7BFb99e32D73e', - rpcport: 80, - }, { coin: 'CHAIN', name: 'Chainmakers', @@ -301,12 +265,6 @@ const supportedCurrencies = [ }, ], }, - { - coin: 'CIX', - name: 'Cryptonetix', - contractAddress: '0x1175a66a5c3343Bbf06AA818BB482DdEc30858E0', - rpcport: 80, - }, { coin: 'CCL', name: 'CoinCollect', @@ -330,6 +288,29 @@ const supportedCurrencies = [ }, ], }, + { + coin: 'COMMOD', + name: 'COMMOD', + asset: 'COMMOD', + rpcport: 27048, + txversion: 4, + overwintered: 1, + required_confirmations: 2, + electrumServers: [ + { + host: 'electrum1.cipig.net', + port: 10022, + }, + { + host: 'electrum2.cipig.net', + port: 10022, + }, + { + host: 'electrum3.cipig.net', + port: 10022, + }, + ] + }, { coin: 'COQUI', name: 'Coqui Cash', @@ -455,15 +436,9 @@ const supportedCurrencies = [ contractAddress: '0x08d32b0da63e2C3bcF8019c9c5d849d7a9d791e6', rpcport: 80, }, - { - coin: 'DEC8', - name: 'DEC8 [Test]', - contractAddress: '0x3aB100442484Dc2414Aa75B2952A0a6f03f8aBFd', - rpcport: 80, - }, { coin: 'DEX', - name: 'InstantDEX', + name: 'DEX', asset: 'DEX', rpcport: 11890, txversion: 4, @@ -513,18 +488,6 @@ const supportedCurrencies = [ decimals: 9, rpcport: 80, }, - { - coin: 'DGPT', - name: 'DigiPulse', - contractAddress: '0xf6cFe53d6FEbaEEA051f400ff5fc14F0cBBDacA1', - rpcport: 80, - }, - { - coin: 'DICE', - name: 'Etheroll', - contractAddress: '0x2e071D2966Aa7D8dECB1005885bA1977D6038A65', - rpcport: 80, - }, { coin: 'DNT', name: 'District0x', @@ -553,36 +516,6 @@ const supportedCurrencies = [ }, ], }, - { - coin: 'DRGN', - name: 'Dragonchain', - contractAddress: '0x419c4dB4B9e25d6Db2AD9691ccb832C8D9fDA05E', - rpcport: 80, - }, - { - coin: 'DROP', - name: 'Dropil', - contractAddress: '0x4672bAD527107471cB5067a887f4656D585a8A31', - rpcport: 80, - }, - { - coin: 'DRT', - name: 'DomRaider', - contractAddress: '0x9AF4f26941677C706cfEcf6D3379FF01bB85D5Ab', - rpcport: 80, - }, - { - coin: 'EDG', - name: 'Edgeless', - contractAddress: '0x08711D3B02C8758F2FB3ab4e80228418a7F8e39c', - rpcport: 80, - }, - { - coin: 'ELD', - name: 'Electrum Dark', - contractAddress: '0xaaF7d4CD097317D68174215395eB02c2ccA81E31', - rpcport: 80, - }, { coin: 'ELF', name: 'aelf', @@ -628,90 +561,18 @@ const supportedCurrencies = [ contractAddress: '0x0000000000000000000000000000000000000000', rpcport: 80, }, - { - coin: 'ETA', - name: 'Etheera', - contractAddress: '0x9195E00402abe385f2D00A32Af40b271F2e87925', - rpcport: 80, - }, - { - coin: 'ETHOS', - name: 'Ethos', - contractAddress: '0x5Af2Be193a6ABCa9c8817001F45744777Db30756', - rpcport: 80, - }, - { - coin: 'FJC', - rpcport: 3776, - pubtype: 36, - p2shtype: 16, - wiftype: 164, - txfee: 100000, - electrumServers: [ - { - host: 'electrumx1.fujicoin.org', - port: 50001, - }, - { - host: 'electrumx2.fujicoin.org', - port: 50001, - }, - { - host: 'electrumx3.fujicoin.org', - port: 50001, - }, - ], - }, - { - coin: 'FLLW', - name: 'FollowCoin', - contractAddress: '0x0200412995f1baFef0D3F97C4E28Ac2515EC1eCE', - rpcport: 80, - }, { coin: 'FSN', name: 'Fusion', contractAddress: '0xD0352a019e9AB9d757776F532377aAEbd36Fd541', rpcport: 80, }, - { - coin: 'FTC', - rpcport: 9337, - pubtype: 14, - p2shtype: 5, - wiftype: 142, - txfee: 1000000, - electrumServers: [ - { - host: 'electrumx-gb-1.feathercoin.network', - port: 50001, - }, - { - host: 'electrumx-gb-2.feathercoin.network', - port: 50001, - }, - { - host: 'electrumx-ch-1.feathercoin.ch', - port: 50001, - }, - { - host: 'electrumx-de-2.feathercoin.ch', - port: 50001, - }, - ], - }, { coin: 'FUN', name: 'FunFair', contractAddress: '0x419D0d8BdD9aF5e606Ae2232ed285Aff190E711b', rpcport: 80, }, - { - coin: 'FYN', - name: 'FundYourselfNow', - contractAddress: '0x88FCFBc22C6d3dBaa25aF478C578978339BDe77a', - rpcport: 80, - }, { coin: 'GAME', rpcport: 40001, @@ -734,18 +595,28 @@ const supportedCurrencies = [ }, ], }, + { + coin: 'GIN', + name: 'Gincoin', + fname: 'GINcoin', + rpcport: 10211, + pubtype: 38, + p2shtype: 10, + wiftype: 198, + txfee: 10000, + electrumServers: [ + { + host: 'electrum2.gincoin.io', + port: 6001, + }, + ] + }, { coin: 'GNO', name: 'Gnosis', contractAddress: '0x6810e776880C02933D47DB1b9fc05908e5386b96', rpcport: 80, }, - { - coin: 'GPN', - name: 'GPN Coin', - contractAddress: '0xE2b407160AAd5540eAc0e80338b9a5085C60F25B', - rpcport: 80, - }, { coin: 'GRS', rpcport: 1441, @@ -778,12 +649,6 @@ const supportedCurrencies = [ contractAddress: '0xC5bBaE50781Be1669306b9e001EFF57a2957b09d', rpcport: 80, }, - { - coin: 'GUP', - name: 'Matchpool', - contractAddress: '0xf7B098298f7C69Fc14610bf71d5e02c60792894C', - rpcport: 80, - }, { coin: 'GUSD', name: 'Gemini dollar', @@ -791,22 +656,10 @@ const supportedCurrencies = [ contractAddress: '0x056Fd409E1d7A124BD7017459dFEa2F387b6d5Cd', rpcport: 80, }, - { - coin: 'HGT', - name: 'HelloGold', - contractAddress: '0xba2184520A1cC49a6159c57e61E1844E085615B6', - rpcport: 80, - }, - { - coin: 'HMQ', - name: 'Humaniq', - contractAddress: '0xcbCC0F036ED4788F63FC0fEE32873d6A7487b908', - rpcport: 80, - }, - /* Disabled because of #289 { coin: 'HODL', asset: 'HODL', + name: 'HODL', rpcport: 14431, txversion: 4, overwintered: 1, @@ -826,34 +679,15 @@ const supportedCurrencies = [ }, ], }, - { - coin: 'HODLC', - name: 'Hodlcoin', - rpcport: 11989, - pubtype: 40, - p2shtype: 5, - wiftype: 168, - txfee: 5000, - electrumServers: [ - { - host: 'hodl.amit.systems', - port: 17989, - }, - { - host: 'hodl2.amit.systems', - port: 17989, - }, - ], - }, - */ { coin: 'HUSH', - rpcport: 8822, - taddr: 28, - pubtype: 184, - p2shtype: 189, - wiftype: 128, - txfee: 1000, + asset: 'HUSH3', + fname: 'Hush', + rpcport: 18031, + txversion: 4, + overwintered: 1, + mm2: 1, + required_confirmations: 2, electrumServers: [ { host: 'electrum1.cipig.net', @@ -869,42 +703,12 @@ const supportedCurrencies = [ }, ], }, - { - coin: 'HYD', - name: 'Hydra', - contractAddress: '0xD233495C48EB0143661fFC8458EAfc21b633f97f', - rpcport: 80, - }, - { - coin: 'ICN', - name: 'Iconomi', - contractAddress: '0x888666CA69E0f178DED6D75b5726Cee99A87D698', - rpcport: 80, - }, - { - coin: 'IND', - name: 'Indorse Token', - contractAddress: '0xf8e386EDa857484f5a12e4B5DAa9984E06E73705', - rpcport: 80, - }, { coin: 'IOST', name: 'IOST', contractAddress: '0xFA1a856Cfa3409CFa145Fa4e20Eb270dF3EB21ab', rpcport: 80, }, - { - coin: 'JOI', - name: 'JointEDU', - contractAddress: '0x58deD6994124B4FFF298f1416aCa3fC9Cdba37b2', - rpcport: 80, - }, - { - coin: 'JST', - name: 'JST (TESTCOIN)', - contractAddress: '0x996a8aE0304680F6A69b8A9d7C6E37D65AB5AB56', - rpcport: 80, - }, { coin: 'JUMBLR', name: 'Jumblr', @@ -966,39 +770,27 @@ const supportedCurrencies = [ rpcport: 80, }, { - coin: 'KV', - name: 'KeyValue', - asset: 'KV', - rpcport: 8299, + coin: 'LABS', + name: 'LABS', + fname: 'Komodo LABS', + rpcport: 40265, txversion: 4, overwintered: 1, required_confirmations: 2, electrumServers: [ { host: 'electrum1.cipig.net', - port: 10016, + port: 10019, }, { host: 'electrum2.cipig.net', - port: 10016, + port: 10019, }, { host: 'electrum3.cipig.net', - port: 10016, + port: 10019, }, - ], - }, - { - coin: 'LALA', - name: 'LALA World', - contractAddress: '0xfD107B473AB90e8Fbd89872144a3DC92C40Fa8C9', - rpcport: 80, - }, - { - coin: 'LIKE', - name: 'LikeCoin', - contractAddress: '0x02F61Fd266DA6E8B102D4121f5CE7b992640CF98', - rpcport: 80, + ] }, { coin: 'LINK', @@ -1045,18 +837,6 @@ const supportedCurrencies = [ }, ], }, - { - coin: 'LUN', - name: 'Lunyr', - contractAddress: '0xfa05A73FfE78ef8f1a739473e462c54bae6567D9', - rpcport: 80, - }, - { - coin: 'LYS', - name: 'Lightyears', - contractAddress: '0xdD41fBd1Ae95C5D9B198174A28e04Be6b3d1aa27', - rpcport: 80, - }, { coin: 'MANA', name: 'Decentraland', @@ -1070,10 +850,27 @@ const supportedCurrencies = [ rpcport: 80, }, { - coin: 'MGO', - name: 'MobileGo', - contractAddress: '0x40395044Ac3c0C57051906dA938B54BD6557F212', - rpcport: 80, + coin: 'MGW', + name: 'MGW', + fname: 'MultiGateway', + rpcport: 12386, + txversion: 4, + overwintered: 1, + required_confirmations: 2, + electrumServers: [ + { + host: 'electrum1.cipig.net', + port: 10015, + }, + { + host: 'electrum2.cipig.net', + port: 10015, + }, + { + host: 'electrum3.cipig.net', + port: 10015, + }, + ], }, { coin: 'MKR', @@ -1093,24 +890,6 @@ const supportedCurrencies = [ contractAddress: '0xe7C33a0E04F2316Bb321C4AD2976873d09538B56', rpcport: 80, }, - { - coin: 'MNX', - rpcport: 17786, - pubtype: 75, - p2shtype: 5, - wiftype: 128, - txfee: 10000, - electrumServers: [ - { - host: 'elex01-ams.turinex.eu', - port: 50001, - }, - { - host: '95.85.35.152', - port: 50001, - }, - ], - }, { coin: 'MONA', rpcport: 9402, @@ -1189,31 +968,12 @@ const supportedCurrencies = [ contractAddress: '0xF433089366899D83a9f26A773D59ec7eCF30355e', rpcport: 80, }, - { - coin: 'MYB', - name: 'MyBit Token', - contractAddress: '0x5d60d8d7eF6d37E16EBABc324de3bE57f135e0BC', - rpcport: 80, - }, - { - coin: 'MYTH', - name: 'Unicoin', - decimals: 18, - contractAddress: '0x277AB4b9DDE09A8E710fd755deeB9d0d9532d047', - rpcport: 80, - }, { coin: 'NAS', name: 'Nebulas', contractAddress: '0x5d65D971895Edc438f465c17DB6992698a52318D', rpcport: 80, }, - { - coin: 'NET', - name: 'Nimiq', - contractAddress: '0xcfb98637bcae43C13323EAa1731cED2B716962fD', - rpcport: 80, - }, { coin: 'NMC', rpcport: 8336, @@ -1248,30 +1008,12 @@ const supportedCurrencies = [ contractAddress: '0x58a4884182d9E835597f405e5F258290E46ae7C2', rpcport: 80, }, - { - coin: 'OCC', - name: 'Original Crypto Coin', - contractAddress: '0x0235fE624e044A05eeD7A43E16E3083bc8A4287A', - rpcport: 80, - }, - { - coin: 'OCT', - name: 'Octus', - contractAddress: '0x7e9d365C0C97Fe5FcAdcc1B513Af974b768C5867', - rpcport: 80, - }, { coin: 'OMG', name: 'OmiseGo', contractAddress: '0xd26114cd6EE289AccF82350c8d8487fedB8A0C07', rpcport: 80, }, - { - coin: 'ONNI', - name: 'Misericordae', - contractAddress: '0xBd9c6028e1132A6B52F1ca15C0933A2FD342E21f', - rpcport: 80, - }, { coin: 'OOT', name: 'Utrum', @@ -1312,24 +1054,12 @@ const supportedCurrencies = [ }, ], }, - { - coin: 'PAT', - name: 'Pangea Arbitration Token', - contractAddress: '0xBB1fA4FdEB3459733bF67EbC6f893003fA976a82', - rpcport: 80, - }, { coin: 'PAY', name: 'TenX', contractAddress: '0xB97048628DB6B661D4C2aA833e95Dbe1A905B280', rpcport: 80, }, - { - coin: 'PCL', - name: 'Peculium', - contractAddress: '0x3618516F45CD3c913F81F9987AF41077932Bc40d', - rpcport: 80, - }, { coin: 'PUNGO', name: 'Pungo Token', @@ -1349,12 +1079,6 @@ const supportedCurrencies = [ }, ], }, - { - coin: 'PLU', - name: 'Pluton', - contractAddress: '0xD8912C10681D8B21Fd3742244f44658dBA12264E', - rpcport: 80, - }, { coin: 'POLY', name: 'Polymath', @@ -1373,24 +1097,6 @@ const supportedCurrencies = [ contractAddress: '0xd4fa1460F537bb9085d22C7bcCB5DD450Ef28e3a', rpcport: 80, }, - { - coin: 'PRL', - name: 'Oyster', - contractAddress: '0x1844b21593262668B7248d0f57a220CaaBA46ab9', - rpcport: 80, - }, - { - coin: 'PURC', - name: 'Peurcoin', - contractAddress: '0x7148B80b38278853Ca8263Cfc0b57d4478ae6A6e', - rpcport: 80, - }, - { - coin: 'PXT', - name: 'Populous XBRL Token', - contractAddress: '0xc14830E53aA344E8c14603A91229A0b925b0B262', - rpcport: 80, - }, { coin: 'RICK', name: 'Rick [Test]', @@ -1543,18 +1249,6 @@ const supportedCurrencies = [ contractAddress: '0x607F4C5BB672230e8672085532f7e901544a7375', rpcport: 80, }, - { - coin: 'RLTY', - name: 'SMARTRealty', - contractAddress: '0xbe99B09709fc753b09BCf557A992F6605D5997B0', - rpcport: 80, - }, - { - coin: 'RVT', - name: 'Rivetz', - contractAddress: '0x3d1BA9be9f66B8ee101911bC36D3fB562eaC2244', - rpcport: 80, - }, { coin: 'SALT', name: 'Salt', @@ -1567,46 +1261,6 @@ const supportedCurrencies = [ contractAddress: '0x7C5A0CE9267ED19B22F8cae653F198e3E8daf098', rpcport: 80, }, - { - coin: 'SANC', - name: 'Sancoj', - contractAddress: '0x03eC7BB59be036870eF696A2abF124f496d6735A', - rpcport: 80, - }, - { - coin: 'SMART', - rpcport: 9679, - pubtype: 63, - p2shtype: 18, - wiftype: 191, - txfee: 200000, - electrumServers: [ - { - host: 'electrum1.smartcash.cc', - port: 50001, - }, - { - host: 'electrum2.smartcash.cc', - port: 50001, - }, - { - host: 'electrum3.smartcash.cc', - port: 50001, - }, - { - host: 'electrum4.smartcash.cc', - port: 50001, - }, - { - host: 'electrum5.smartcash.cc', - port: 50001, - }, - { - host: 'electrum6.smartcash.cc', - port: 50001, - }, - ], - }, { coin: 'SNGLS', name: 'SingularDTV', @@ -1619,18 +1273,6 @@ const supportedCurrencies = [ contractAddress: '0x744d70FDBE2Ba4CF95131626614a1763DF805B9E', rpcport: 80, }, - { - coin: 'SPANK', - name: 'SpankChain', - contractAddress: '0x42d6622deCe394b54999Fbd73D108123806f6a18', - rpcport: 80, - }, - { - coin: 'SRN', - name: 'SIRIN LABS Token', - contractAddress: '0x68d57c9a1C35f63E2c83eE8e49A64e9d70528D25', - rpcport: 80, - }, { coin: 'STORJ', name: 'Storj', @@ -1643,24 +1285,6 @@ const supportedCurrencies = [ contractAddress: '0xD0a4b8946Cb52f0661273bfbC6fD0E0C75Fc6433', rpcport: 80, }, - { - coin: 'STRM41', - name: 'Stream41', - contractAddress: '0xbaD7a7F7bA71CE3659fE6dCaD34aF86b9DE2A4B2', - rpcport: 80, - }, - { - coin: 'STWY', - name: 'StorweeyToken', - contractAddress: '0x8A8C71f032362fCA2994f75D854f911Ec381AC5A', - rpcport: 80, - }, - { - coin: 'SUB', - name: 'Substratum', - contractAddress: '0x8D75959f1E61EC2571aa72798237101F084DE63a', - rpcport: 80, - }, { coin: 'SUPERNET', name: 'Supernet', @@ -1684,12 +1308,6 @@ const supportedCurrencies = [ }, ], }, - { - coin: 'SWT', - name: 'Swarm City', - contractAddress: '0xB9e7F8568e08d5659f5D29C4997173d84CdF2607', - rpcport: 80, - }, { coin: 'TAAS', name: 'TaaS', @@ -1702,18 +1320,6 @@ const supportedCurrencies = [ contractAddress: '0x6531f133e6DeeBe7F2dcE5A0441aA7ef330B4e53', rpcport: 80, }, - { - coin: 'TKN', - name: 'TokenCard', - contractAddress: '0xaAAf91D9b90dF800Df4F55c205fd6989c977E73a', - rpcport: 80, - }, - { - coin: 'TRST', - name: 'Trust', - contractAddress: '0xCb94be6f13A1182E4A4B6140cb7bf2025d28e41B', - rpcport: 80, - }, { coin: 'TUSD', name: 'TrueUSD', @@ -1721,9 +1327,9 @@ const supportedCurrencies = [ rpcport: 80, }, { - coin: 'UCASH', - name: 'U.CASH', - contractAddress: '0x92e52a1A235d9A103D970901066CE910AAceFD37', + coin: 'USDC', + fname: 'USD Coin', + contractAddress: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', rpcport: 80, }, // Temporarily disabled as it's not working with mm2 @@ -1742,27 +1348,33 @@ const supportedCurrencies = [ overwintered: 1, required_confirmations: 2, electrumServers: [ + // TODO: check in with 0x03 on VRSC discord to replace, use cipi in meantime + // { + // host: 'el0.vrsc.0x03.services', + // port: 10000, + // }, + // { + // host: 'el1.vrsc.0x03.services', + // port: 10000, + // }, + // { + // host: 'el2.vrsc.0x03.services', + // port: 10000, + // }, { - host: 'el0.vrsc.0x03.services', - port: 10000, + host: 'electrum1.cipig.net', + port: 10021 }, { - host: 'el1.vrsc.0x03.services', - port: 10000, + host: 'electrum2.cipig.net', + port: 10021 }, { - host: 'el2.vrsc.0x03.services', - port: 10000, + host: 'electrum3.cipig.net', + port: 10021 }, ], }, - { - coin: 'VSL', - name: 'vSlice', - contractAddress: '0x5c543e7AE0A1104f78406C340E9C64FD9fCE5170', - decimals: 18, - rpcport: 80, - }, { coin: 'VTC', rpcport: 5888, @@ -1789,18 +1401,6 @@ const supportedCurrencies = [ }, ], }, - { - coin: 'WAX', - name: 'WAX', - contractAddress: '0x39Bb259F66E1C59d5ABEF88375979b4D20D98022', - rpcport: 80, - }, - { - coin: 'WINGS', - name: 'Wings', - contractAddress: '0x667088b212ce3d06a1b553a7221E1fD19000d9aF', - rpcport: 80, - }, { coin: 'WLC', name: 'Wireless Coin', @@ -1830,18 +1430,6 @@ const supportedCurrencies = [ contractAddress: '0xb7cB1C96dB6B22b0D3d9536E0108d062BD488F74', rpcport: 80, }, - { - coin: 'XAUR', - name: 'Xarum', - contractAddress: '0x4DF812F6064def1e5e029f1ca858777CC98D2D81', - rpcport: 80, - }, - { - coin: 'XOV', - name: 'XOVBank', - contractAddress: '0x153eD9CC1b792979d2Bde0BBF45CC2A7e436a5F9', - rpcport: 80, - }, { coin: 'XZC', rpcport: 8888, diff --git a/app/portfolio-util.js b/app/portfolio-util.js index 830b0e482c..795166e548 100644 --- a/app/portfolio-util.js +++ b/app/portfolio-util.js @@ -61,6 +61,7 @@ const removedCurrencies = [ 'BLK', 'FAIR', 'SIB', + "HODLC", ]; const createPortfolio = async ({name, seedPhrase, password}) => { diff --git a/app/renderer/api.js b/app/renderer/api.js index 8e8500dda9..50807fb07f 100644 --- a/app/renderer/api.js +++ b/app/renderer/api.js @@ -4,7 +4,11 @@ import PQueue from 'p-queue'; import ow from 'ow'; import _ from 'lodash'; import {getCurrency} from '../marketmaker/supported-currencies'; -import {isDevelopment} from '../util-common'; +// import {isDevelopment} from '../util-common'; + +// NOTE: temporarily turn off this feature +// enable when we merge code +const isDevelopment = false; const symbolPredicate = ow.string.uppercase; const uuidPredicate = ow.string.matches(/[a-z\d-]/); @@ -90,7 +94,9 @@ export default class Api { ow(symbol, 'symbol', symbolPredicate); // TODO: Remove `OOT` when https://github.com/KomodoPlatform/atomicDEX-API/issues/492 is fixed - if (symbol === 'OOT' || symbol === 'USDT') { + // above TODO should be fixed. + // if (symbol === 'OOT' || symbol === 'USDT') { + if (symbol === 'USDT') { console.error(`Ignoring ${symbol} currency as it's not working with mm2`); return; } @@ -109,10 +115,12 @@ export default class Api { // protocol: 'SSL', })); + try { const response = await this.request({ method: 'electrum', coin: symbol, + mm2: currency.mm2, servers, }); @@ -153,15 +161,13 @@ export default class Api { } } - // Mm v2 doesn't currently have an endpoint for disabling a coin, so we do nothing. - // https://github.com/artemii235/SuperNET/issues/459 - async disableCurrency(/** symbol */) { - /// ow(symbol, 'symbol', symbolPredicate); + async disableCurrency(symbol) { + ow(symbol, 'symbol', symbolPredicate); - // return this.request({ - // method: 'disable', - // coin: symbol, - // }); + return this.request({ + method: 'disable_coin', + coin: symbol, + }); } // Mm v2 @@ -223,15 +229,30 @@ export default class Api { } // Mm v2 - async orderStatus(uuid) { + // Note: new api + async cancelAllOrdersByPair(baseCurrency, quoteCurrency) { + const {result} = await this.request({ + method: 'cancel_all_orders', + cancel_by: { + type: 'Pair', + data: { + base: baseCurrency, + rel: quoteCurrency + } + } + }); + + return result; + } + + // Mm v2 + orderStatus(uuid) { ow(uuid, 'uuid', uuidPredicate); - const {result} = await this.request({ + return this.request({ method: 'order_status', uuid, }); - - return result; } // Mm v2 @@ -247,13 +268,26 @@ export default class Api { } // Mm v2 - // https://github.com/artemii235/developer-docs/blob/mm/docs/basic-docs/atomicdex/atomicdex-api.md#my_recent_swaps - // TODO: Add support for the input arguments it supports. - async myRecentSwaps() { + // https://developers.atomicdex.io/basic-docs/atomicdex/atomicdex-api.html#my-orders + async myOrders() { const {result} = await this.request({ - method: 'my_recent_swaps', + method: 'my_orders', }); + return result; + } + + // Mm v2 + // https://github.com/artemii235/developer-docs/blob/mm/docs/basic-docs/atomicdex/atomicdex-api.md#my_recent_swaps + // TODO: Add support for the input arguments it supports. + async myRecentSwaps(fromUUID = null) { + const query = { + method: 'my_recent_swaps' + }; + if(!fromUUID) { + query.from_uuid = fromUUID; + } + const {result} = await this.request(query); return result.swaps; } @@ -267,6 +301,32 @@ export default class Api { return result; } + // Mm v2 + // https://developers.atomicdex.io/basic-docs/atomicdex/atomicdex-api.html#cancel-all-orders + async cancelAllOrders() { + const {result} = await this.request({ + method: 'cancel_all_orders', + cancel_by: { + type: 'All' + } + }); + + return result; + } + + // Mm v2 + // https://developers.atomicdex.io/basic-docs/atomicdex/atomicdex-api.html#get-trade-fee + async getTradeFee(currency) { + ow(currency, 'currency', symbolPredicate); + + const {result} = await this.request({ + method: 'get_trade_fee', + coin: currency, + }); + + return result; + } + // Mm v2 // https://github.com/artemii235/developer-docs/blob/mm/docs/basic-docs/atomicdex/atomicdex-api.md#cancel_order async cancelOrder(uuid) { diff --git a/app/renderer/components/SwapDetails.js b/app/renderer/components/SwapDetails.js index 4fab37d618..153d6d8bb5 100644 --- a/app/renderer/components/SwapDetails.js +++ b/app/renderer/components/SwapDetails.js @@ -63,28 +63,18 @@ class SwapDetails extends React.Component { config.set('swapModalShowAdvanced', showAdvanced); }; - render() { - const { - swapId, - open, - didClose, - } = this.props; - - if (!swapId) { - return null; - } - - const swap = appContainer.state.swapHistory.find(swap => swap.uuid === swapId); - const {baseCurrency, quoteCurrency} = swap; + showTransaction = swap => { + if(!swap) return null; const transactions = swap.stages.map(stage => ( - +
{stage.event.data && stage.event.data.tx_hash ? (
{t(`swapStages.${stage.event.type}`)}
-

{stage.event.data.total_amount}
{stage.event.data.coin}

+ {/*

{stage.event.data.total_amount}
{stage.event.data.coin}

*/} + {parseFloat(stage.event.data.my_balance_change) !== 0 && (

{stage.event.data.my_balance_change}
{stage.event.data.coin}

)}
) : ( @@ -94,14 +84,13 @@ class SwapDetails extends React.Component { )}
)); - - if (swap.status === 'swapping') { + if (swap.totalStages) { for (const stageType of swap.totalStages) { const isStageFinished = swap.stages.some(x => x.event.type === stageType); if (!isStageFinished) { transactions.push( - +
{t(`swapStages.${stageType}`)}
@@ -112,8 +101,35 @@ class SwapDetails extends React.Component { } } + return ( +
+ {transactions} +
+ ); + } + + render() { + const { + swapId, + open, + didClose, + } = this.props; + + if (!swapId) { + return null; + } + + // const swap = appContainer.state.swapHistory.find(swap => swap.uuid === swapId); + const order = appContainer.state.ordersHistory.find(order => order.uuid === swapId); + // get last swap + let swap = null; + if(order.swaps.length > 0) + swap = order.swaps[order.swaps.length - 1]; + + const {baseCurrency, quoteCurrency} = order; + const prices = ['requested', 'broadcast', 'executed'].map(value => { - if (!swap[value].price) { + if (!order[value].price) { return null; } @@ -121,23 +137,23 @@ class SwapDetails extends React.Component {
{t(`details.${value}`)}

- {t(`details.${swap.orderType}`)}: {zeroPadFraction(swap[value].baseCurrencyAmount)} {baseCurrency} + {t(`details.${order.action}`)}: {zeroPadFraction(order[value].baseCurrencyAmount)} {baseCurrency}
- {t('details.for')}: {zeroPadFraction(swap[value].quoteCurrencyAmount)} {quoteCurrency} + {t('details.for')}: {zeroPadFraction(order[value].quoteCurrencyAmount)} {quoteCurrency}
- {t('details.price')}: {zeroPadFraction(swap[value].price)} {quoteCurrency} + {t('details.price')}: {zeroPadFraction(order[value].price)} {quoteCurrency}

); }); - const overview = getOverview(swap); + const overview = getOverview(order); const titleComponent = (
-
{title(swap.statusFormatted)}
-
{baseCurrency}/{quoteCurrency} {t(`details.${swap.orderType}`)} {t('details.order')}
-
{formatDate(swap.timeStarted, 'HH:mm DD/MM/YY')}
+
{title(order.statusFormatted)}
+
{baseCurrency}/{quoteCurrency} {t(`details.${order.orderType}`)} {t('details.order')}
+
{formatDate(order.timeStarted, 'HH:mm DD/MM/YY')}
); @@ -153,16 +169,16 @@ class SwapDetails extends React.Component { > <>
- {swap.isActive && ( + {order.isOpen && (
@@ -174,7 +190,7 @@ class SwapDetails extends React.Component {

{overview.fromTitle}

{overview.fromAmount} {overview.fromCurrency}

- {!swap.isActive && ( + {!order.isOpen && ( )}
@@ -196,11 +212,11 @@ class SwapDetails extends React.Component {

- {(swap.status === 'failed' && swap.error) && ( + {swap && (swap.status === 'failed' && swap.error) && ( swap.error.message )}

- {swap.statusInformation && ( + {swap && swap.statusInformation && (

{swap.statusInformation}

)}
@@ -210,23 +226,25 @@ class SwapDetails extends React.Component {
{prices}
- {swap.executed.percentCheaperThanRequested > 0 && ( + {/* {swap && swap.executed && swap.executed.percentCheaperThanRequested > 0 && (

{t('details.stats', { - percentCheaperThanRequested: swap.executed.percentCheaperThanRequested, + percentCheaperThanRequested: swap && swap.executed.percentCheaperThanRequested, })}

- )} + )} */}
- {(transactions.length > 0) && ( + {(order.swaps.length > 0) && ( <>

{t('details.transactions')}

-
- {transactions} -
+ {order.swaps.map(this.showTransaction)} )} -

ID: {swap.uuid}

+

+ ID: {order.uuid} +
+ Type: {t(`details.${order.orderType}`)} +

{isDevelopment &&